Archived

This topic is now archived and is closed to further replies.

Starting off

This topic is 5012 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Howzit I''m trying to get the first tutorial of the OpenGL tutorials at gametutorials.com to work, and it''s giving me this in Dev-C++: [Linker error] undefined reference to `WinMain@16'' I''ve got a main method and I''ve included the relevent files in my project options. Shot

Share this post


Link to post
Share on other sites
Try changing the linker settings. It sounds like you''re building the application for the windows subsystem when you want to build the application for the console subsystem.

Share this post


Link to post
Share on other sites
I have put it as a console system. I don''t know what the hell is going on. This is what I have for my linker options:

../lib/libSDL.a
../lib/libSDLmain.a
../lib/libmingw32.a
../lib/libopengl32.a
../lib/libglu32.a

Including windows.h and providing the nessacary library file doesn''t work either.

Share this post


Link to post
Share on other sites
When using gcc with SDL you have to specify the main function to be the SDL main function, which then calls your main(). On the command line you would add -Dmain=SDL_main, not sure how that integrates into Dev-C++

Also you don''t have to include windows.h just

#include <sdl/sdl.h>
#include <gl/gl.h>
#include <gl/glu.h>

I also think that you must use this signature for main, however I am not sure, but it won''t hurt anyways.

int main(int argc, char **argv)

The parameters are mandatory.

Hope that this helps you out.

Share this post


Link to post
Share on other sites
You might also try putting SDLMain.a before SDL.a in the link order. IIRC, reversing the order sometimes causes conflicts.

Share this post


Link to post
Share on other sites