[Kaffe] problem with bad libgif link in CVS code
Moses DeJong
dejong at cs.umn.edu
Tue Jan 26 20:50:40 PST 1999
On 27 Jan 1999, Alexandre Oliva wrote:
> On Jan 27, 1999, Moses DeJong <dejong at cs.umn.edu> wrote:
>
> >> > I could not find libgif on my system and I had no clue how to fix the
> >> > configure.in script so I just tossed a hack into configure so that the
> >> > contest compile failed. After installing I now had no link to libgif.
>
> > That is the problem. There does not seem to be a libgif on my system.
> > I have no idea what the compiler is linking to and I have done a
> > find / -name "libgif*" and found nothing. Is there any way to make
> > gcc print out where the libs it uses for linking are located?
>
> I don't think so, this would be an `ld' thing. You may try to run
>
> strace -e trace=open -f gcc conftest.c -o conftest
>
> --
> Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org}
> oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
> Universidade Estadual de Campinas, SP, Brasil
I tired it again and it looks like I was wrong before. Using the Gnu ld
seems to work but using the sun ld does not (this is on a Solaris Sparc
box version 5.6).
/opt/gnu/bin/ld -o run conftest.o -lgif -lc
/usr/ucb/ld -o run conftest.o -lgif -lc
ld: fatal: library -lgif: not found
ld: fatal: File processing errors. No output written to run
I was able to find the lib like so.
/opt/gnu/bin/ld --cref -o run conftest.o -lgif -lc | grep Gif
DGifOpenFileHandle /usr/local/lib/libgif.so
So the problem was not that the lib did not exist but that the
runtime linker did not know how to find it. This can be fixed
one of two ways.
ldd run
libgif.so.3 => (file not found)
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
mo(~)% setenv LD_LIBRARY_PATH /usr/local/lib
mo(~)% ldd run
libgif.so.3 => /usr/local/lib/libgif.so.3
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
Or.
mo(~)% gcc -o run conftest.c -L/usr/local/lib -R/usr/local/lib -lgif
mo(~)% ldd run
libgif.so.3 => /usr/local/lib/libgif.so.3
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
So I guess the real way to fix this problem is to add /usr/local/lib
to the runtime search path in the configure script. Does anyone
know how I could od that. I have not done much hacking on the Kakke
configure process so I would not know where to start.
later
mo dejong
dejong at cs.umn.edu
More information about the kaffe
mailing list