Starting off
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
#include "windows.h"
Or perhaps you havent defined the WinMain method
[edited by - psamty10 on March 24, 2004 1:21:16 AM]
Or perhaps you havent defined the WinMain method
[edited by - psamty10 on March 24, 2004 1:21:16 AM]
That didn''t work, it still gave me the same error.
I''ve got a main() function NOT a WinMain() function.
I''ve got a main() function NOT a WinMain() function.
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.
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.
../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.
That still didn''t work.
What else can I use instead of SDL? Or do I have to use anything at all?
What else can I use instead of SDL? Or do I have to use anything at all?
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.
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.
You might also try putting SDLMain.a before SDL.a in the link order. IIRC, reversing the order sometimes causes conflicts.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement