Thursday 7 July 2011

When I try to run the program foo I get "error while loading shared libraries: libfoo.so"


check the libraries the program foo uses with :
$ ldd foo

check if libfoo.so is in the output of:
$ ldconfig -v

Solutions:
(1) Add directories with your libraries into /etc/ld.so.conf (recommended method):
$ cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf
/usr/lib/mylibdir

(2) Ubuntu generally looks for library in /usr/lib and /usr/local/lib so add your libraries in these directories (not recommended method)

References:
$ man ldconfig
$ man ldd

No comments:

Post a Comment