[Error] Error while loading shared libraries
This post is written by YoungJ-Baek
1. Preface
There are two types of library, static and dynamic. Sometimes, you may face an error related to shared libraries even though you have built it well. It’s because you have compiled and built it well, but it has been built in the user path, /usr/local/lib
2. Error
The error log below is an example of my case, libpango_windowing.so
problem.
Error Log
error while loading shared libraries: libpango_windowing.so: cannot open shared object file: No such file or directory
3. Solution
3.1. make configuration file
Command
$ cd /etc/ld.so.conf.d/
$ sudo vi libpango_windowing.conf
You can replace libpango_windowing.conf
with your problematic shared library in form of lib{xxxxxx}.conf
. Then, type the line below in the configuration file.
lib{xxxxx}.conf
/usr/local/lib
Then, type the command below after saving the configuration file
Command
$ sudo /sbin/ldconfig
3.2. Add Library Path
Add library path in the prompt or profile.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{library path}
Leave a comment