I've tried just about everything to get SDL to work with Dev-C++. I've linked the files -lSDL -lmingw32 -mwindows in, I've installed the SDL package, the includes are all there, yet a simple program that mainly just has "return 0;" just to test compile turns out the error E:\DEV-C_~1\Lib\\libmingw32.a(main.o)(.text+0x7f):main.c: undefined reference to `WinMain@16'
I've asked for help before, and people mention something about linking to the output of sdl-config. Could somebody help me with my problem? If I need to link to the output of sdl-config, how could I do so?
Help is very much appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The correct link options are:
-lmingw32 -lSDLmain -lSDL
Because SDL uses main instead if WinMain the SDLmain has to be linked. You do not have to link mwindows if you choose a window app in the project options (you can also compile it as console app, but then devcpp will open a console from which you app is launched, and this look silly).
stephan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've tried just about everything to get SDL to work with Dev-C++. I've linked the files -lSDL -lmingw32 -mwindows in, I've installed the SDL package, the includes are all there, yet a simple program that mainly just has "return 0;" just to test compile turns out the error E:\DEV-C_~1\Lib\\libmingw32.a(main.o)(.text+0x7f):main.c: undefined reference to `WinMain@16'
I followed all the steps presented here: http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut1
I've asked for help before, and people mention something about linking to the output of sdl-config. Could somebody help me with my problem? If I need to link to the output of sdl-config, how could I do so?
Help is very much appreciated.
sdl-config is a bash script used on *nix platforms. Since you're using Windows, you can't use it.
-lSDL - lmingw32 -mwindows aren't files, they are just linker options, make sure you're putting them in the right place (linker options).
The correct link options are:
-lmingw32 -lSDLmain -lSDL
Because SDL uses main instead if WinMain the SDLmain has to be linked. You do not have to link mwindows if you choose a window app in the project options (you can also compile it as console app, but then devcpp will open a console from which you app is launched, and this look silly).
stephan