Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Why oh why

  1. #1
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    Manchester - UK
    Posts
    138

    Why oh why

    Well I'm getting closer!

    I managed to get my head around installing xFree4.0.1 and I've got the glut and glu libs and header files.

    Compilation of the simplest program goes well, but 'ld' can't link the object code to the gl libraries.

    The -L params are set correctly, take a look.

    Code :
    gcc program.c -I/usr/local/include -I/usr/X11R6/include -L/usr/local/lib -L/usr/X11R6/lib -lglut -glu -gl -o program
    The linker reckons it can't find 'lglut', if I change the order of the library declarations, it says it can't find whichever comes first in the list.

    Now I double checked and everything IS where its supposed to be - so anyone know whats going on?

    Thanks,
    Paul.
    Paul Groves
    [b] pauls opengl page

  2. #2
    Guest

    Re: Why oh why

    You might try changing the order of the linked items, putting your object file before the libraries.

  3. #3
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    Manchester - UK
    Posts
    138

    Re: Why oh why

    I got it compiling. Silly me, didn't know that the Linux console in case sensitive so a big "DOH!" and slap on the forehead for me.

    Now my executable can't find the libraries it needs; it keeps saying that libGLU.so.1 is missing - it is, but theres a symbolic link file called libGLU.so.1 that points to libGLU.so.1.2 in the X11R6/lib directory - does this need to go anywhere else?

    Interestingly I deleted the link files for libGL.so.1.2, when I did this the console said it couldn't find libGL.so.1 - but when I re-made the symbolic link from .so.1 to .so.1.2 it worked again.

    SO why does it work for libGL and not for libGLU ?

    Thanks,
    Paul.
    Paul Groves
    [b] pauls opengl page

  4. #4
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    San Diego, CA, USA
    Posts
    110

    Re: Why oh why

    Are you having an adventure with Linux?

    libGL.so -> libGL.so.major
    libGL.so.major -> libGL.so.major.minor

    So the last one is the real deal. Just make sure you have these links setup properly.

    Use `ls -l` to show what the links are pointing to.

    /skw|d

  5. #5
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    Manchester - UK
    Posts
    138

    Re: Why oh why

    Linux turned out to be more of an 'adventure' than I thought it would

    Okay, getting angry now...

    I deleted all the symbolic links that I made to GL related stuff and rebuilt them as you suggested in the /usr/X11R6/lib directory:

    libGL.so.1.2 -> libGL.so.1 -> libGL.so
    libGLU.so.1.2 -> libGLU.so.1 -> libGLu.so
    libglut.so.3.7.0 -> libglut.so.3.7 -> libglut.so.3 -> libglut.so

    It still gives the same error message:

    "error in loading shared libraries: libGLU.so.1: Cannot open shared object file: No such file or directory."

    The symbolic linking works for libGL.so.1, so why not GLU? Could it be my versions of the library? Where did everybody get their versions from? Moreover, if they're different can I have them?

    Is there a 'path' like - to use the DOS analogy - that I have to set or anything? I'm getting pretty peeved now.
    Paul Groves
    [b] pauls opengl page

  6. #6
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    San Diego, CA, USA
    Posts
    110

    Re: Why oh why

    The path for libraries is defined in /etc/ld.so.conf. If you change this file, as root do `ldconfig`. This updates the ld.so.cache file.

    Your gcc command line uses -L to basicly ignore the ld.so.conf file. But a binary uses it when it wants to lookup a library.

    /skw|d

  7. #7
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    Manchester - UK
    Posts
    138

    Re: Why oh why

    I'll give this a try - thanks. I'm supposed to have looked in the multitude of 'how-tos' but didn't see anything like that.

    Still, I love the tab auto complete - I think I could get used to Linux
    Paul Groves
    [b] pauls opengl page

  8. #8
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    Manchester - UK
    Posts
    138

    Re: Why oh why

    Right, the ld.so.conf file checked out - the paths were already in there. 'ldconfig' updated the cache and the program doesn't complain about the lack of libraries anymore.

    It does however crash with a seg fault and dumps the core before it does anything interesting though...

    Suggestions? Maybe I should try a different version of glut and glu? Does anyone know where to download the binaries for these?

    Thanks for all the help,
    Paul.
    Paul Groves
    [b] pauls opengl page

  9. #9
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    Manchester - UK
    Posts
    138

    Re: Why oh why

    It crashes because I don't have a GLX X server (!) I thought that was implicit... So what now?
    Paul Groves
    [b] pauls opengl page

  10. #10
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    San Diego, CA, USA
    Posts
    110

    Re: Why oh why

    Excuse me, I'm kinda drunk right now.

    All of this should be covered in your INSTALL docs. glx is a module loaded by the X server (edit /etc/X11/XF86Config). I don't like how you are saying that programs are seg faulting.. maybe you should install your GL drivers over from scratch?

    /skw|d

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •