LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   OpenGL and SDL app wont compile (http://www.linuxquestions.org/questions/programming-9/opengl-and-sdl-app-wont-compile-393035/)

redneon 12-15-2005 03:04 AM

OpenGL and SDL app wont compile
 
I'm writing a particle system for my final year dissertation and it works fine in Windows but when I come to compile it in Linux using the following command:

g++ main.cpp -o ParticleSystem `sdl-config --libs` -lGL -lGLU

I get the following error:

/usr/lib/gcc-lib/i486-slackware-linux/3.3.6/../../../../i486-slackware-linux/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status

I know that the command should work because I used to use the exact same command recently when I was running the previous version of Slackware (I'm now on 10.2).

geeman2.0 12-15-2005 09:45 AM

Just a guess based on my dim memories of compiling opengl apps in slackware.

Maybe it slackware sticks the libraries in an unconventional location which you need to specify on the command line.

TheLinuxDuck 12-15-2005 02:05 PM

Firstly, I would suspect that sdl-config --lib is not returning the appropriate library path. I'd physically verify that the GLU library file is in a path provided by the sdl-config --libs, and if not, then there you go, and you can provide that lib path in your compile string.

If it is located in that path, then I would suspect that it might have to do with the ordering of the compile string. I've had problems in the past that seemed really weird, but it was simply a matter of putting the library paths and files first before the code I'm compiling.

If it still is giving you problems, try running "ldconfig" to update the shared library information, then compile again. If that doesn't work, then I would create a symlink to the actual GLU library in /usr/lib, so that there can be no doubt in finding it.

Hopefully one of these items will help!

TLD

beanerjo 02-24-2006 11:16 PM

Why not add -L/usr/X11R6/lib?

xhi 02-25-2006 09:45 PM

sdl-config should not tell you where glut is as it is not sdl..

do as beanerjo suggested and it should compile..


All times are GMT -5. The time now is 06:04 AM.