Pretty newbie SDL question.

sorry, but its late at night and i dont know why i am getting the following error when trying to compile an SDL app

[Linker error] undefined reference to `WinMain@16’

now, i have -lsdl in the compiler options, and i have included the sdl lib and all, got the dll’s in the system dir, got all the libs in the library dir and all the headers in the righ place, i got now idea why it aint woerking…
more specifically:

Executing gcc.exe…
gcc.exe “C:\SDL-1.2.4 est estoverlay.c” -o “C:\SDL-1.2.4 est estoverlay.exe” -lsdl -s -I"C:\DEV-CPP\include" -L"C:\DEV-CPP\lib"
C:\DEV-CPP\lib/libmingw32.a(main.o)(.text+0x7f):main.c: undefined reference to `WinMain@16’

Execution terminated

[This message has been edited by MrShoe (edited 09-23-2002).]

Hi,
You need to add -lmingw32 at the beginning of your list of linker libraries.

See http://www.clg-net.com/ai/cprogramming.htm for more details.

Regards,
ChuckB

Thank GOD it worked thanks mate, and i was sitting hee at 2am in the morning thinking i was a complete jackass… i was even thinkning of joining the dark side and opening up VC6
btw, i had to inlucde sdlmain as well in the linking for it to work fully.

Glad it worked. I cannot tell you how long I spent trying to get the right libraries setup in the linker options…and in the correct order as well. :frowning:

Dev-C++, OpenGL, GLUT and SDL are pretty cool when they are configured correctly. :wink:

Regards,
ChuckB