Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading shared libraries of boost

I am working on centos. I installed boost version 1.45.0 on my system. The programs are compiled correctly but whenever I type command to see output it gives following error:

./a.out: error while loading shared libraries: libboost_thread.so.1.45.0: cannot open shared object file: No such file or directory

like image 331
Shweta Avatar asked May 05 '26 17:05

Shweta


1 Answers

In addition to the other answers, you can also set the DT_RPATH elf tag when linking your executable

-Wl,-rpath,/path/to/boost/libraries -L /path/to/boost/libraries -lboost_whatever

This way you don't have to remember to set your LD_LIBRARY_PATH if the libraries are installed in a non-standard location.

like image 112
Sam Miller Avatar answered May 07 '26 06:05

Sam Miller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!