Compiling Problem

Started by
11 comments, last by CableGuy 17 years, 1 month ago
Hi, Recently I installed Ubuntu 6.10 on my PC but I can't get OpenGL programs to compile, I downloaded the first linux example from CodeSampler but when i make it i get cc -o ogl_glx_sample -g ogl_glx_sample.cpp -lGL -lGLU /usr/bin/ld: cannot find -lGL collect2: ld returned 1 exit status make: *** [ogl_glx_sample] Error 1 so that means it cant find the gl libs but i installed the nvidia-glx-dev package as instructed on various places in the net. Any clue?
Advertisement
Hmm... that should work. I'd guess you're missing /usr/lib/libGL.la which should be in nvidia-glx-dev. However it also seems to me that the program shouldn't work anyway because you aren't linking in the X11 libraries, or SDL, or any way to create an OpenGL context, so try that as well.
I have the ligGL.la file in place, also the program compiled once,
but then I reinstalled the os and now it wont compile...
Can you use apt-get to download and reinstall the OpenGL and all other associated libraries again?

It might help.
add the library-path using "-L/here/is/the/lib"

You have to do this, if your library is not in an ordinary directory like /usr/lib or /lib.

You may also make a symlink in /usr/lib to your special GL library. That'd work as well.
Nope nothing,
The libs are there in usr/lib.
Tried to remove and then install again.
Still no luck im clueless...
show us the "$ ls -l /usr/lib | grep GL"
I cannot believe that there's a libGL.a
ls -l /usr/lib | grep GL
lrwxrwxrwx 1 root root 21 2007-03-23 17:44 libGLcore.so.1 -> libGLcore.so.1.0.9755
-rwxr-xr-x 1 root root 9918780 2007-03-23 17:44 libGLcore.so.1.0.9755
-rw-r--r-- 1 root root 91504 2006-07-06 17:53 libGLEW.a
lrwxrwxrwx 1 root root 16 2007-03-25 01:37 libGLEW.so -> libGLEW.so.1.3.4
lrwxrwxrwx 1 root root 16 2007-03-23 15:28 libGLEW.so.1.3 -> libGLEW.so.1.3.4
-rw-r--r-- 1 root root 188032 2006-07-06 17:53 libGLEW.so.1.3.4
-rw-r--r-- 1 root root 660 2007-02-27 23:22 libGL.la
lrwxrwxrwx 1 root root 17 2007-03-25 00:57 libGL.so -> libGL.so.1.0.8776
lrwxrwxrwx 1 root root 17 2007-03-23 17:44 libGL.so.1 -> libGL.so.1.0.9755
-rwxr-xr-x 1 root root 601720 2007-03-23 17:44 libGL.so.1.0.9755
-rw-r--r-- 1 root root 684432 2006-10-12 05:53 libGLU.a
lrwxrwxrwx 1 root root 11 2007-03-23 19:08 libGLU.so -> libGLU.so.1
lrwxrwxrwx 1 root root 20 2007-03-23 15:28 libGLU.so.1 -> libGLU.so.1.3.060501
-rw-r--r-- 1 root root 499436 2006-10-12 05:53 libGLU.so.1.3.060501

Thats it...
ls -l /usr/lib | grep GL
lrwxrwxrwx 1 root root 21 2007-03-23 17:44 libGLcore.so.1 -> libGLcore.so.1.0.9755
-rwxr-xr-x 1 root root 9918780 2007-03-23 17:44 libGLcore.so.1.0.9755
-rw-r--r-- 1 root root 91504 2006-07-06 17:53 libGLEW.a
lrwxrwxrwx 1 root root 16 2007-03-25 01:37 libGLEW.so -> libGLEW.so.1.3.4
lrwxrwxrwx 1 root root 16 2007-03-23 15:28 libGLEW.so.1.3 -> libGLEW.so.1.3.4
-rw-r--r-- 1 root root 188032 2006-07-06 17:53 libGLEW.so.1.3.4
-rw-r--r-- 1 root root 660 2007-02-27 23:22 libGL.la
lrwxrwxrwx 1 root root 17 2007-03-25 00:57 libGL.so -> libGL.so.1.0.8776
lrwxrwxrwx 1 root root 17 2007-03-23 17:44 libGL.so.1 -> libGL.so.1.0.9755
-rwxr-xr-x 1 root root 601720 2007-03-23 17:44 libGL.so.1.0.9755
-rw-r--r-- 1 root root 684432 2006-10-12 05:53 libGLU.a
lrwxrwxrwx 1 root root 11 2007-03-23 19:08 libGLU.so -> libGLU.so.1
lrwxrwxrwx 1 root root 20 2007-03-23 15:28 libGLU.so.1 -> libGLU.so.1.3.060501
-rw-r--r-- 1 root root 499436 2006-10-12 05:53 libGLU.so.1.3.060501

Well, theres your problem! libGL.so points to libGL.so.1.0.8776 which you do not have, and not libGL.so.1.0.9755. Probably a distro bug..
So you know how can I fix this problem.
I really dont know nothing about linux just started :)

This topic is closed to new replies.

Advertisement