CDT CDT - 4 months ago 12
Linux Question

Linux - SO file not found

I have a program which requires

liblog4cpp
installed to run. Now I want the program to run on another machine without
liblog4cpp
. So I just find the
log4cpp.so
and move it to the same directory of my program. But at running error reported:

error while loading shared libraries: liblog4cpp.so.4: cannot open shared object file: No such file or directory


Am I doing it right ? How can I told the program to find the SO file just beside it ?

Tom Tom
Answer

Check your LD_LIBRARY_PATH environment variable... One of the directories on the path should point to the location of your log4cpp.so file; also the linux command ldd is handy for determining which shared object libraries are being used in your executable. The syntax is ldd <executable>.