PDA

View Full Version : Distributing binaries with shared libraries


tralalalala
October 4th, 2006, 08:57 PM
I am trying to send a program to somebody who does not have some of the shared libraries that the program depends on. I tried putting the program and the shared libraries in the same directory, and then running the program, but I get the following error:

./program: error while loading shared libraries: libmylib.so.1: cannot open shared object file: No such file or directory

Is there anywhere that I can look to figure out how to do this without using static linking?

Thanks!

Houman
October 4th, 2006, 10:20 PM
Hi there,

ld, the dynamic loader/linker, has to know where to find your shared libraries. I suggest you try adding the path to the shared libraries to " /etc/ld.so.conf" and then running ldconfig as root to update the cache.

regards,
Houman

amo-ej1
October 5th, 2006, 05:01 AM
Or for quick check you could also use the environment variable LD_LIBRARY_PATH

see http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html