wWinmain, Unicode, and Mingw

Viewed 16004

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.

3 Answers

I know that I should have commented instead of answering, but I don't have enough reputation.

I want to add that I had to change the links to exe files in [Settings > Compiler... > Toolchain Executables > Program Files] in order to get the version of Community to run.

Also my CodeBlocks from 2016 claimed that it was Unicode but the -municode option didn't work, only the MiniGW update to the version by Community worked.

If you want to use main instead of wmain again, you have to delete -municode option.

Related