On 4/21/06, linux23dragon <[EMAIL PROTECTED]> wrote:
>
> The only way I could get the "fgl-gears32.c" to compile, was to create
> symbolic links (for testing perposes only) from /opt/lib{libGL*,LibXrender*}
> to /usr/lib.
<snip>
> [EMAIL PROTECTED]:~/fgl_glxgears32$ make
> cc -o fgl_glxgears32 -lGL -lXrender fgl_glxgears32.o
> /usr/bin/ld: cannot find -lGL
> collect2: ld returned 1 exit status
> make: *** [fgl_glxgears32] Error 1
> [EMAIL PROTECTED]:~/fgl_glxgears32$

This is because /usr/bin/ld isn't controlled by /etc/ld.so.conf.  It's
a bit confusing at first, but there are two ld's.  One is
/lib/ld-linux.so.2, the dynamic linker from glibc.  This is controlled
by /etc/ld.so.conf and determines where shared libraries are found at
run time.

When compiling, gcc and /usr/bin/ld, the dynamic loader from binutils,
need to find libraries like libGL.so in this case.  In general, gcc
tells ld where to find the libraries using a built in path.  If a
library is outside the path, you can add its directory with a -L
directive.  Normally, configure figures this out for you and you don't
have to do anything.  In this case, though, you'd have to put
-L/opt/lib in front of -lGL on the LIB line in Makefile.  You could
probably pass it with a variable, too, but I don't know how the shell
script works.

> Oh yea, on the side note.  If you install the Nvidia Open-gl libs in /opt, you
> will find that the  libGL.la file will have this following line:
>
> -------//---start of line 13 0f the /opt/lib/libGL.la file-------//-----
>
> # Libraries that this one depends upon.
> dependency_libs=' -L/usr/X11R6/lib -lm -lXext -lX11 -ldl'

Stuff like this unfortunately happens here and there with people
hard-coding the location of /usr/X11R6.

--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to