Error loading shared libraries: libsandbox.so
The " lost " problem is not unique to libsandbox
. This is the case with many self-compiling libraries that use GNU autotools for build configuration.
The problem is that GNU autotools prepares the library for /usr/local/lib
the default (and there are good reasons for keeping this setting as default, such as FHS compliance). However, on some Linux distributions such as Ubuntu and ArchLinux , the runtime linker (aka. ld.so
) Does not search /usr/local/lib
for shared libraries unless otherwise specified via ldconfig
.
While all of the other solutions from @ anton-kovalenko's answer are viable, it would be more convenient if you just configure libsandbox
with parameters --prefix=/usr
and --libdir=/usr/lib
(if you have write access to /usr/lib
, from the course). Or, you can add a new entry ldconfig
in /etc/ld.so.conf.d
to enable /usr/local/lib
system-level search libraries.
DISCLAIMER: I am the author libsandbox
.
source to share
You do the following:
- You will first discover where it is copied
libsandbox.so
. This is probably the place if you've successfully contacted it. - Then you try to use
env LD_LIBRARY_PATH=/directory/of/your/libsandbox/copy/ ./sandbox
and see if it works. - Then you decide how to deploy your program along with the library so that it works on the target machine. There are many possibilities:
gcc -Wl,-rpath='$ORIGIN'
for linking it will make itlibsandbox.so
bootable from an executable directory. Another solution is a wrapper script that takes care ofLD_LIBRARY_PATH
. Placelibsandbox.so
in a location where the dynamic linker can find another.
source to share