Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-15-2005, 03:04 AM   #1
Registered: Aug 2003
Posts: 103

Rep: Reputation: 15
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).
Old 12-15-2005, 09:45 AM   #2
Registered: Feb 2005
Location: Ontario, Canada
Distribution: Gentoo, Slackware
Posts: 345

Rep: Reputation: 30
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.
Old 12-15-2005, 02:05 PM   #3
Registered: Sep 2002
Location: Tulsa, OK
Distribution: Slack, baby!
Posts: 349

Rep: Reputation: 33
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!

Old 02-24-2006, 11:16 PM   #4
Registered: Aug 2004
Location: New Zealand
Distribution: Slackware
Posts: 40

Rep: Reputation: 15
Why not add -L/usr/X11R6/lib?
Old 02-25-2006, 09:45 PM   #5
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
sdl-config should not tell you where glut is as it is not sdl..

do as beanerjo suggested and it should compile..


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using SDL/OpenGL, need help. kornerr Programming 33 11-19-2005 11:19 PM
sdl / opengl - cant press up and right atrain Linux - Games 2 03-27-2005 11:29 PM
Pascal App Wont Compile (newb, help!) flamesrock Programming 0 10-20-2004 10:48 PM
Using OpenGL (+SDL) for 2D programs R00ts Programming 4 07-16-2004 12:33 PM
OpenGL lighting with SDL MadCactus Programming 0 09-21-2003 11:52 AM > Forums > Non-*NIX Forums > Programming

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration