LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-15-2005, 03:04 AM   #1
redneon
Member
 
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
geeman2.0
Member
 
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
TheLinuxDuck
Member
 
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!

TLD
 
Old 02-24-2006, 11:16 PM   #4
beanerjo
Member
 
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
xhi
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..
 
  


Reply


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


All times are GMT -5. The time now is 01:35 PM.

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