[Top][All Lists]

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

Re: "error while loading shared libraries: cannot open shared

From: Bob Friesenhahn
Subject: Re: "error while loading shared libraries: cannot open shared object file: No such file or directory"
Date: Sun, 16 Dec 2007 14:06:03 -0600 (CST)

On Sun, 16 Dec 2007, Laurence Darby wrote:

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

Your email seems to contain a lot of details, but upon closer inspection the details are not of the right type. For example, you have not even identified the operating system you are using.

Sometimes linker failures while installing shared librares are because the shared libraries were installed in the wrong order, and re-linking using the final installed locations was required. For example, perhaps library B depends on library A, but library B is being installed before library A. Automake does not handle this automatically.


There are lots of "fixes" (of which adding /usr/local/lib to
/etc/ 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

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

       * (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 and add "-rpath $(libdir)" to
its binfoo_LDFLAGS (nothing to do with libfoo_...) and rebuild it.

I read the manual:
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/, 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/, but something else entirely, defined in glibc (I
think, but where else?) as


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/ should just be appended to it.


Bob Friesenhahn
GraphicsMagick Maintainer,

reply via email to

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