PDA

View Full Version : Linking Error in Ubuntu 10.04



Pourya
05-29-2011, 08:57 PM
Hi Everyone,
I am struggling with a linking problem. I am trying to rebuild an app in linux which used to work fine in windows. I am linking it against libGL, libGLU and libGLEW but it keeps saying:

cannot find -llibglut VideoGallery

I checked the paths with ldconfig tool:

ldconfig -v | grep GL
/sbin/ldconfig.real: Can't stat /lib/i486-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can't stat /lib64: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib64: No such file or directory
/sbin/ldconfig.real: Cannot stat /usr/lib/mesa/libGL.so: No such file or directory
libGLU.so.1 -> libGLU.so.1.3.070701
libGLEW.so.1.5 -> libGLEW.so.1.5.2
libGL.so.1 -> libGL.so.270.41.19

I have installed all libs and I am using NVIDIA driver on this machine.

Please help. Thanks

ZbuffeR
05-30-2011, 12:11 AM
On debian/ubuntu, make sure to install freeglut-dev.
Or red-hat/fedora, sudo yum install freeglut-dev.
Then it should be -lglut and not -llibglut.

Pourya
05-30-2011, 05:59 PM
Thanks ZBuffer, But How about GL, GLU, GLUT and GLEW?


I still receive error:

make all
Building target: OpenGLTest
Invoking: GCC C++ Linker
g++ -L/usr/lib -o"OpenGLTest" ./src/OpenGLTest.o -lGL -lGLU -lglut
/usr/bin/ld: cannot find -lGL
collect2: ld returned 1 exit status

Pourya
05-30-2011, 06:14 PM
Fixed it. The libs were: glut, GLU, GLEW, ftgl that I used.
Apparently no GL is needed.

Thanks