Boost librairies not found, but compilation ok

I am trying to use file system from boost in C ++

It seems compilation is ok when using

"C ++ -c Analyse.c -o Analyse.o -g -W -Wall -L / usr / local / lib -lboost_filesystem -lboost_system"

However, when I try to execute my code, the following error occurs:

"when loading shared libraries: libboost_filesystem.so.1.54.0: cannot open shared objects file: there is no such file or directory", find / -iname "libboost_system.so.1.54.0

I had some problems installing boost (I first installed 1.49 and after that 1.54), so I was wondering if there could be a conflict between version 2?

PS: btw a "find / -iname "libboost_system.so.1.54.0" gave me the following

 /usr/include/boost/boost_1_54_0/bin.v2/libs/system/build/gcc-4.7/release/threading-multi/libboost_system.so.1.54.0 /usr/local/lib/libboost_system.so.1.54.0 
+4
source share
2 answers

Try adding a directory before executing. For example: LD_LIBRARY_PATH="/usr/local/lib/" ./Analyse.o

+4
source

I ran into this problem quite recently after a new boost installation. In my case, the solution was just to run

 sudo ldconfig 

The explanation is that the system stores the cache memory of installed shared libraries (located in /usr/lib , /lib , /usr/local/lib ). When libraries change or new ones are added, the cache is not updated until ldconfig . See the ldconfig manual for more ldconfig .

0
source

Source: https://habr.com/ru/post/1497902/


All Articles