[SDL] OpenGL example compiling error.

Mikael Eriksson mikael.miffe.eriksson at gmail.com
Mon Sep 12 02:10:06 PDT 2005


Omar Baqueiro wrote:
> Hi, I am trying to compile the example  2.8 from the SDL library 
> documentation in Devc++
> (http://manuals.thexdershome.com/SDL-1.2.5/html/guidevideoopengl.html 
> <http://manuals.thexdershome.com/SDL-1.2.5/html/guidevideoopengl.html>)
> 
> I create a new console project, and compile with the following command:
> gcc.exe -D__DEBUG__ main.o  -o "SDLOpenGL.exe" -L"C:/Dev-Cpp/lib" 
> -lmingw32 -lopengl32 -lglu32 -lSDL -lSDLmain  -g3 -mwindows
> 
> But I get the following error:
> 
> C:/Dev-Cpp/lib/libSDLmain.a(SDL_win32_main.o)(.text+0x38a): In function 
> `console_main':
> /home/hercules/public_cvs/SDL12/src/main/win32/SDL_win32_main.c:244: 
> undefined reference to `SDL_SetModuleHandle'
> collect2: ld returned 1 exit status
> 
> If I link without the -lmingw32 flag i get an undefined reference to 
> Winmain at 16   error.
> 
> What am I doing wrong?

Not sure but i think you should switch places between -lSDL and 
-lSDLmain to -lSDLmain -lSDL

Thats what my sdl-config --libs says anyway.

> Thank you!
> 
> 
> 
> 
> -- 
> Omar Baqueiro Espinosa
> Computer Systems Engineer
> Home: www.csc.liv.ac.uk/~omar/ <http://www.csc.liv.ac.uk/~omar/>
> Calendar: calendar.yahoo.com/obaqueiro 
> <http://calendar.yahoo.com/obaqueiro>
> PGP Key available at: www.csc.liv.ac.uk/~omar/pgp.html 
> <http://www.csc.liv.ac.uk/~omar/pgp.html>
> _____
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl





More information about the SDL mailing list