libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"error while loading shared libraries: foo.so.0: cannot open shared obje


From: Laurence Darby
Subject: "error while loading shared libraries: foo.so.0: cannot open shared object file: No such file or directory"
Date: Sun, 16 Dec 2007 14:05:32 +0000

Hi,

I think this is either an automake problem or a libtool problem, (or
maybe even a glibc problem) so cc'ing both lists.  Please cc me on
replies. My apologies in advance to those subscribed to both lists :)

Far too many times, I have run ./configure && make && sudo make install
on a new piece of software, tried to run it, and I get the above error
message.

There are lots of "fixes" (of which adding /usr/local/lib to 
/etc/ld.so.conf is *not* one), here they are in the order I discovered
them (and I don't need to be told now that they were wrong) :

1 - reboot

2 - ./configure --prefix=/usr

3 - Set LD_LIBRARY_PATH to permanently contain /usr/local/lib.

4 - Manually run ldconfig as root after the install.

5 - Remove -n from ldconfig from the make install.  But I see in
    libtool/ChangeLog.1997: 

1997-11-28  Gordon Matzigkeit  <address@hidden>

        * ltconfig.in (finish_cmds): Change back to using `ldconfig -n'.
        This makes Linux behave like other systems, which is more in
        line with what libtool needs.

6 - Edit the new program's Makefile.am and add "-rpath $(libdir)" to
its binfoo_LDFLAGS (nothing to do with libfoo_...) and rebuild it.

I read the manual:
http://www.gnu.org/software/automake/manual/html_node/Conditional-Libtool-Libraries.html#Conditional-Libtool-Libraries
but I still don't get why "-rpath $(libdir)" can't be automatically
passed to libtool. 

That's probably wrong too, because libtool has the variable
$sys_lib_dlsearch_path, which already contains /usr/local/lib (picked up
from /etc/ld.so.conf), but according to a comment, deliberately skips it
because it's part of the "system default run-time" search path, and I
guess adding -rpath $(libdir) forces it back in.

IMHO, libtool is wrong to skip it, and the "system default run-time"
is not /etc/ld.so.conf, but something else entirely, defined in glibc (I
think, but where else?) as 

/lib/tls/i686/sse2/
/lib/tls/i686
/lib/tls/sse2
etc...

which is searched before printing the "no such file or directory" error
message.  I couldn't find where that list is defined, does anyone know?
Maybe /etc/ld.so.conf should just be appended to it.

Thanks,
Laurence




reply via email to

[Prev in Thread] Current Thread [Next in Thread]