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 tell the program to find the SO file just beside it?
These files are normally stored in /lib/ or /usr/lib/.
An . so file is a compiled library file. It stands for "Shared Object" and is analogous to a Windows DLL. Often, package files will place these under /lib or /usr/lib or some place similar when they're installed.
ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld. so.
In addition to what others are suggesting, consider adding the file to the dynamic linker's cache. You can do it like this:
ldconfig -l /path/to/lib/liblog4.so.4
To add it to the loader's cache use the following command: ldconfig
Then in order to verify that it was correctly added, run this:
ldconfig -v | grep liblog
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With