Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while loading shared library: libconfig++.so.9

While I compile the code in Makefile, I've put LINKPATH = -L/usr/local/lib in the g++ line. And of course "libconfig++.so.9" is under /usr/local/lib

But when I execute the executable file, it still says cannot find libconfig++.so.9.

Anyone knows why?? Appreciate any help.

like image 234
hsienting Avatar asked Jul 22 '11 15:07

hsienting


People also ask

How do you fix Cannot open shared object file no such file or directory?

Fix ing 'cannot open shared object file: No such file or directory' error. One quick way to fix this “error while loading shared libraries” automatically is to use ldconfig. This one liner should solve the problem in most cases.

How do I open a shared library file?

If you want to open a shared-library file, you would open it like any other binary file -- with a hex-editor (also called a binary-editor). There are several hex-editors in the standard repositories such as GHex (https://packages.ubuntu.com/xenial/ghex) or Bless (https://packages.ubuntu.com/xenial/bless).


2 Answers

You should define LD_LIBRARY_PATH. For example:

export LD_LIBRARY_PATH=/usr/local/lib
like image 170
dpaluy Avatar answered Sep 28 '22 01:09

dpaluy


or just use

sudo ldconfig -v

like image 35
xjzhou Avatar answered Sep 28 '22 01:09

xjzhou