I am working on learning the windows API and am using mingw as my compiler with Code::Blocks as my IDE. I have run into an issue with using the wWinMain function. I used the program located here link text. It compiles fine on VSC++ 2008 express but when using mingw i get the “undefined reference to WinMain@16” error. I have figured out what the problem is (i think). By replacing the wWinMain with just Winmain and the String pointer PWSTR with LPSTR it compiles perfectly. My question is, how can i fix this, and if not, is not using Unicode that big of a deal.
Thanks.
Use the plain (non unicode)
WinMainfunction, and then get your unicode command line usingGetCommandLineW. MinGW doesn’t know aboutwWinMain.You are probably going to find working on MinGW difficult; last time I used it it did not support most of the
wchar_tcomponents of the C++ standard library (i.e.std::wifstream,std::wstring, etc) which made interfacing with Unicode Windows bits difficult.Do you have anything against MSVC?