tags:

views:

86

answers:

1

Hello, 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.

+1  A: 

Use the plain (non unicode) WinMain function, and then get your unicode command line using GetCommandLineW. MinGW doesn't know about wWinMain.

You are probably going to find working on MinGW difficult; last time I used it it did not support most of the wchar_t components 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?

Billy ONeal
I dont have anything against MSVC, its just i thought one cant release software you make with the express edition. Even though im a long ways from that point, i want to be able to legally when i can.
JAKE6459
@JAKE: There is no restriction on what kind of software you may build with MSVC Express Editions. The only difference between the full and express editions are that the full editions have *significantly* more features, such as the ability to install MSVC plugins (i.e. Visual Assist X). But there is no restriction on the compiled code -- it comes not from Visual Studio in any case but from the Windows SDK.
Billy ONeal
Oh, shows what all I know, thanks, I think I will probably start using VS then.
JAKE6459