Error loading shared libraries

user459811 picture user459811 · Dec 23, 2010 · Viewed 46k times · Source

I'm running eclipse on Ubuntu using a g++ compiler and I'm trying to run a sample program that utilizes xerces.

The build produced no errors however, when i attempted to run the program, I would receive this error:

error while loading shared libraries: libxerces-c-3.1.so: cannot open shared object file: No such file or directory

libxerces-c-3.1.so is in the directory /opt/lib which I have included as a library in eclipse. The file is there when I checked the folder. When I perform an echo $LD_LIBRARY_PATH, /opt/lib is also listed.

Any ideas into where the problem lies? Thanks.

An ldd libxerces-c-3.1.so command yields the following output:

linux-vdso.so.1 =>  (0x00007fffeafff000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00007fa3d2b83000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa3d2966000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fa3d265f000)
libm.so.6 => /lib/libm.so.6 (0x00007fa3d23dc000)
libc.so.6 => /lib/libc.so.6 (0x00007fa3d2059000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fa3d1e42000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa3d337d000)

Answer

ipk picture ipk · Feb 22, 2012

Try running ldconfig as root to see if it solves the problem.