• Advertisement
Sign in to follow this  

Compiling Problem

This topic is 3986 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I have the ligGL.la file in place, also the program compiled once,
but then I reinstalled the os and now it wont compile...

Share this post


Link to post
Share on other sites
Can you use apt-get to download and reinstall the OpenGL and all other associated libraries again?

It might help.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Nope nothing,
The libs are there in usr/lib.
Tried to remove and then install again.
Still no luck im clueless...

Share this post


Link to post
Share on other sites
show us the "$ ls -l /usr/lib | grep GL"
I cannot believe that there's a libGL.a

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
Another question though.
I can run the application by double clicking it in the file manager.
But how can I run it in the command-line?
I tried sh but it give me:
./ogl_glx_sample: 1: Syntax error: "(" unexpected

Thanks in advance.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement