[SDL] Why do I need a WinMain() if I include <windows.h> under cygwin but not if I use MSVC?

Eric Lilja mindcooler at gmail.com
Wed Nov 8 07:44:04 PST 2006


Peter Mulholland wrote:
> Hello Eric,
> 
> Friday, November 3, 2006, 11:31:56 PM, you wrote:
> 
>> As the topic says...if I include <windows.h> in my SDL program written
>> in C++ I need to replace main() with WinMain() for the linker to link
>> if I'm compiling under cygwin (using mingw sdl binaries). However, if
>> I use the same code in SDL with MSVC++ it works with main(). This 
>> annoying and it would be nice to solve it.
> 
> If the linker says WinMain() is missing, you are not doing -lSDLmain
> with mingw.
> 
> 

I don't have to. I solved it by chaning the include order of the headers.

/ E





More information about the SDL mailing list