From: Brian K. <bk...@em...> - 2005-01-29 21:15:35
|
Command line order matters for mingw. Try linking like this: gcc example.o -o example -lSDLmain -lSDL -lmingw32 -lopengl32 -lglu32 Generally if a library depends on another then it should come earlier on the command line (eg. SDL depends on opengl in this example so place the SDL lib before the opengl lib). - brian SourceForge.net wrote: >Read and respond to this message at: >https://sourceforge.net/forum/message.php?msg_id=2966586 >By: tverweij > >I am trying to compile the SDL+OpenGL example that can be found in the >SDL documentation (I got it from the Windows SDLRef.chm). It is also here >http://www.cs.vu.nl/~tverweij/stuff/example.c > >I am using MinGW (currently the most recent MinGW-3.2.0-rc-3.exe installation) >to compile & link, (I've also tried the older MinGW-3.1.0-1.exe release). I >installed SDL from the SDL-devel-1.2.8-mingw32.tar.gz archive. I also tried >1.2.7, since I read that there were some problems with 1.2.8. Unfortunately >this does not make a difference. > >Compiling works fine. >Trying to link without any libraries (obviously) generates the following >errors: >http://www.cs.vu.nl/~tverweij/stuff/errors_more.txt >If I add all libs I think are required, only a few of the errors are gone: >http://www.cs.vu.nl/~tverweij/stuff/errors_less.txt > >Most of the link errors remain there. Many SDL and OpenGL related functions >cannot be found for some reason. Only SDL_Init, SDL_Quit and SDL_GetError suddenly >seem to be found, but all of the other references are still undefined. > >The linker does not complain about any of the libraries. If I change any of >the options to -lblahblah, then it does complain, so I guess the libraries are >found. (I have added the MinGW\bin directory to the PATH environment variable) >Any help would be welcome. > >______________________________________________________________________ >You are receiving this email because you elected to monitor this forum. >To stop monitoring this forum, login to SourceForge.net and visit: >https://sourceforge.net/forum/unmonitor.php?forum_id=7134 > > >------------------------------------------------------- >This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting >Tool for open source databases. Create drag-&-drop reports. Save time >by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. >Download a FREE copy at http://www.intelliview.com/go/osdn_nl >_______________________________________________ >MinGW-users mailing list >Min...@li... > >You may change your MinGW Account Options or unsubscribe at: >https://lists.sourceforge.net/lists/listinfo/mingw-users > > |