Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: /usr/bin/ld: cannot find -lglut

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    5

    /usr/bin/ld: cannot find -lglut

    I have installed Mesa-6.0 and install glut-3.7-8.i386.rpm using rpm. However, when I compile my code, I got the below error:

    gcc -I/usr/X11R6/include/ -o myWindow -L/usr/X11R6/lXmu -lGL -lGLU -lm -lglut
    /usr/bin/ld: cannot find -lglut
    collect2: ld returned 1 exit status
    make: *** [myWindow] Error 1

    Based on previous thread, I did ls /usr/lib/libglut* and I have the following files:
    /usr/lib/libglut.so.3 /usr/lib/libglut.so.3.7

    Again, I did echo $LD_LIBRARY_PATH, I got the below message:
    /usr/lib:/usr/local/lib/

    After I re-complie my code, the same error re-appears. Can anyone advise what to do and what can be done next.

    Thank you.

  2. #2
    Junior Member Newbie
    Join Date
    Jan 2004
    Location
    Norway
    Posts
    9

    Re: /usr/bin/ld: cannot find -lglut

    You should try to compile with this:

    gcc -I/usr/X11R6/include/ -o myWindow -L/usr/X11R6/lXmu -L/usr/X11R6/lib -lGL -lGLU -lm -lglut

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    5

    Re: /usr/bin/ld: cannot find -lglut

    Originally posted by lulf:
    You should try to compile with this:

    gcc -I/usr/X11R6/include/ -o myWindow -L/usr/X11R6/lXmu -L/usr/X11R6/lib -lGL -lGLU -lm -lglut

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    5

    Re: /usr/bin/ld: cannot find -lglut

    The same error still persists.

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2004
    Posts
    6

    Re: /usr/bin/ld: cannot find -lglut

    Joseph:

    I have pretty much the exact same problem as you at the moment.

    Im trying to compile some OpenSG tutorial examples with the makefile that comes with it, which also tries to include '-lglut' and doesnt find it. And i also have /usr/lib/libglut.so.3.

    If you come up with the solution please post it here.

  6. #6
    Junior Member Newbie
    Join Date
    Feb 2004
    Posts
    6

    Re: /usr/bin/ld: cannot find -lglut

    Ok, i used the whole path /usr/lib/libglut.so.3 instead of just -lglut and it works.. but if i have /usr/lib in my LD_LIBRARY_PATH it should work either way shouldnt it?

  7. #7
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    5

    Re: /usr/bin/ld: cannot find -lglut

    Originally posted by Dingo Egret:
    Ok, i used the whole path /usr/lib/libglut.so.3 instead of just -lglut and it works.. but if i have /usr/lib in my LD_LIBRARY_PATH it should work either way shouldnt it?

    Thanks...now it can compile. However, the below error come up:
    gcc -I/usr/X11R6/include/ -o myWindow -L/usr/X11R6/lib -L/usr/lib/libglut.so.3
    myWindow.o -lGL -lGLU -lX11 -lXmu -lXi -lXext -lm
    myWindow.o: In function `main':
    myWindow.o(.text+0xa5): undefined reference to `glutInit'
    myWindow.o(.text+0xb2): undefined reference to `glutInitDisplayMode'
    myWindow.o(.text+0xc7): undefined reference to `glutInitWindowSize'
    myWindow.o(.text+0xd9): undefined reference to `glutInitWindowPosition'
    myWindow.o(.text+0xe9): undefined reference to `glutCreateWindow'
    myWindow.o(.text+0xf9): undefined reference to `glutDisplayFunc'
    myWindow.o(.text+0x109): undefined reference to `glutMouseFunc'
    myWindow.o(.text+0x116): undefined reference to `glutMainLoop'
    collect2: ld returned 1 exit status
    make: *** [myWindow] Error 1

    Any idea how to solve this undefined reference to '***'?

Posting Permissions

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