Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 tell the program to find the SO file just beside it?

like image 866
CDT Avatar asked Aug 31 '13 11:08

CDT


People also ask

Where are so files in Linux?

These files are normally stored in /lib/ or /usr/lib/.

What is .so file in Unix?

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.

What does Ldconfig do in Linux?

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.


1 Answers

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
like image 86
NlightNFotis Avatar answered Oct 03 '22 04:10

NlightNFotis