Error loading shared library: libconfig ++. So.9

While I am compiling the code in the Makefile, I 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, it still says that it cannot find libconfig ++. so.9.

Does anyone know why? Appreciate any help.

+5
source share
2 answers

You must define LD_LIBRARY_PATH. For instance:

export LD_LIBRARY_PATH=/usr/local/lib
+5
source

or just use

sudo ldconfig -v

+5
source

All Articles