Game Development Community

Linking issues...

by Patrick Twohig · in Torque Game Engine · 10/28/2006 (4:44 pm) · 5 replies

Getting a linking error. I searched the forums, found sombody with a similar problem...however....

I'm getting this linking error...

--> Linking out.GCC4.DEBUG/torqueDemo_DEBUG.bin
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
make[1]: *** [out.GCC4.DEBUG/torqueDemo_DEBUG.bin] Error 1
make: *** [default] Error 2

I have libGLU...

~localhost $ ls -la /usr/lib/libGLU*
-rw-r--r-- 1 root root 752 Oct 28 13:08 /usr/lib/libGLU.la
lrwxrwxrwx 1 root root 11 Oct 28 13:08 /usr/lib/libGLU.so -> libGLU.so.1
lrwxrwxrwx 1 root root 20 Oct 28 13:08 /usr/lib/libGLU.so.1 -> libGLU.so.1.3.060501
lrwxrwxrwx 1 root root 20 Oct 28 13:08 /usr/lib/libGLU.so.1.3 -> libGLU.so.1.3.060501
-rwxr-xr-x 1 root root 556052 Oct 28 13:08 /usr/lib/libGLU.so.1.3.060501


~localhost $ cat /etc/ld.so.conf
..
/usr/lib/
...

Sure enough I have the library, and it's in there!

#1
10/28/2006 (5:38 pm)
"su" and run "ldconfig" and try again.
#2
10/28/2006 (6:15 pm)
I did, technically I ran env-update which implicity runs taht. But, even when I manually type ldconfig it still doesn't work >< That's what boggles my mind about this problem.
#3
10/28/2006 (6:19 pm)
~localhost $ ldconfig -v|grep GLU
ldconfig: Can't stat /opt/blackdown-jdk-1.4.2.03/jre/lib/i686: No such file or directory
ldconfig: Can't stat /opt/blackdown-jdk-1.4.2.03/jre/lib/i686/native_threads: No such file or directory
ldconfig: Can't stat /opt/blackdown-jdk-1.4.2.03/jre/lib/i686/client: No such file or directory
ldconfig: Can't stat /opt/blackdown-jdk-1.4.2.03/jre/lib/i686/server: No such file or directory
ldconfig: Path '/usr/lib' given more than once
ldconfig: Cannot stat /usr/i686-pc-linux-gnu/lib/libopcodes-2.15.92.0.2.so: No such file or directory
ldconfig: Cannot stat /usr/i686-pc-linux-gnu/lib/libbfd-2.16.1.so: No such file or directory
ldconfig: Cannot stat /usr/i686-pc-linux-gnu/lib/libopcodes-2.16.so: No such file or directory
ldconfig: Cannot stat /usr/i686-pc-linux-gnu/lib/libopcodes-2.16.1.so: No such file or directory
ldconfig: Cannot stat /usr/i686-pc-linux-gnu/lib/libbfd-2.15.92.0.2.so: No such file or directory
ldconfig: Cannot stat /usr/i686-pc-linux-gnu/lib/libbfd-2.16.so: No such file or directory
ldconfig: File /usr/lib/libgdbm.so.2 is empty, not checked.
libGLU.so.1 -> libMesaGLU.so
#4
10/28/2006 (7:26 pm)
Odd, here's something really strange. In an attempt to narrow down the problem I mistakenly added -verbose the this part of the Makefile.


LINK.LIBS.GENERAL = $(LINK.LIBS.VORBIS) -verbose,-Wl,-static -Wl,-lGLU -Wl,-dy -L/usr/X11R6/lib -lSDL -lpthread -ldl # -lefence

LINK.LIBS.TOOLS = $(LINK.LIBS.VORBIS) -verbose,-Wl,-static -Wl,-lGLU -Wl,-dy -L/usr/X11R6/lib -lSDL -lpthread -ldl # -lefence
# -lefence is useful for finding memory corruption problems
LINK.LIBS.SERVER = $(LINK.LIBS.VORBIS) -lpthread -lSDL -L/usr/X11R6/lib
LINK.LIBS.RELEASE = -lXft --verbose
LINK.LIBS.DEBUG = -lXft --verbose


g++: unrecognized option '-verbose,-Wl,-static'

I mistakenly added -verbose instead of --verbose. But, it produced an executable which seems to run, but it's obviously missing something. It looks like what I'm doing really ends up dynamically linking libGLU if I'm not mistaken. But, it appears that libGLU does not crash when I run the FPS demo. Any helpful insight would be greatly appreciated.
#5
10/30/2006 (12:53 pm)
This page is the most recent and most pertinent one I could find:
www.garagegames.com/mg/forums/result.thread.php?qt=53032

Alternatively, there have been several threads on the forums recently about GLU and the relative merits of dynamically linking it.

Gary (-;