-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
zig c++ fails to compiles windows with wWinMain/wmain when windows.h is imported #9924
Copy link
Copy link
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsMicrosoft WindowsMicrosoft Windows
Milestone
Description
Zig Version
0.8
Steps to Reproduce
#include <windows.h>
#include <iostream>
int wmain(int argc, wchar_t** argv) {
std::wcout << L"Hello world!" << std::endl;
if(argc == 2){
std::wcout << argv[1] << std::endl;
}
return 0;
}
zig c++ -target x86_64-windows-gnu test.cpp
Expected Behavior
Should compile as it does with clang++
PS C:\Users\User\Documents\zig_cc_exp> clang++ .\zig_test.cpp PS C:\Users\User\Documents\zig_cc_exp> .\a.exe Hello world!
Actual Behavior
PS C:\Users\User\Documents\zig_cc_exp> zig c++ -target x86_64-windows-gnu .\zig_test.cpp
lld-link: error: undefined symbol: WinMain
>>> referenced by mingw32.lib(crt0_c.obj):(main)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsMicrosoft WindowsMicrosoft Windows