I just installed the boost 1.49 version on ubuntu and the process went smooth. however, now when I am running any of my files(hence I am not posting the c++ file because it is happening with every file that use libboost_date_time), I get the following error:
./test.shared.array.exe: error while loading shared libraries: libboost_date_time.so.1.49.0: cannot open shared object file: No such file or directory
I checked to see where boost.build installed the library and I see the libboost_date_time.so.1.49.0 in /usr/local/
why then would I be getting such error. how can i fix the issue.
these are the contents of the /usr/local/boost_1_49_0
/usr/local/boost_1_49_0$ ls
b2 boost-build.jam bootstrap.bat index.htm libs rst.css
bin.v2 boostcpp.jam bootstrap.log index.html LICENSE_1_0.txt status
bjam boost.css bootstrap.sh INSTALL more tools
boost boost.png doc Jamroot project-config.jam
and this is what I have in
/usr/local/lib$ ls
libboost_chrono.a libboost_prg_exec_monitor.so.1.49.0
libboost_chrono.so libboost_program_options.a
libboost_chrono.so.1.49.0 libboost_program_options.so
libboost_date_time.a libboost_program_options.so.1.49.0
libboost_date_time.so libboost_random.a
libboost_date_time.so.1.49.0 libboost_random.so
libboost_exception.a libboost_random.so.1.49.0
libboost_filesystem.a libboost_regex.a
libboost_filesystem.so libboost_regex.so
libboost_filesystem.so.1.49.0 libboost_regex.so.1.49.0
libboost_graph.a libboost_serialization.a
libboost_graph.so libboost_serialization.so
libboost_graph.so.1.49.0 libboost_serialization.so.1.49.0
libboost_iostreams.a libboost_signals.a
libboost_iostreams.so libboost_signals.so
libboost_iostreams.so.1.49.0 libboost_signals.so.1.49.0
libboost_locale.a libboost_system.a
libboost_locale.so libboost_system.so
libboost_locale.so.1.49.0 libboost_system.so.1.49.0
libboost_math_c99.a libboost_test_exec_monitor.a
libboost_math_c99f.a libboost_thread.a
libboost_math_c99f.so libboost_thread.so
libboost_math_c99f.so.1.49.0 libboost_thread.so.1.49.0
libboost_math_c99l.a libboost_timer.a
libboost_math_c99l.so libboost_timer.so
libboost_math_c99l.so.1.49.0 libboost_timer.so.1.49.0
libboost_math_c99.so libboost_unit_test_framework.a
libboost_math_c99.so.1.49.0 libboost_unit_test_framework.so
libboost_math_tr1.a libboost_unit_test_framework.so.1.49.0
libboost_math_tr1f.a libboost_wave.a
libboost_math_tr1f.so libboost_wave.so
libboost_math_tr1f.so.1.49.0 libboost_wave.so.1.49.0
libboost_math_tr1l.a libboost_wserialization.a
libboost_math_tr1l.so libboost_wserialization.so
libboost_math_tr1l.so.1.49.0 libboost_wserialization.so.1.49.0
libboost_math_tr1.so ocaml
libboost_math_tr1.so.1.49.0 perl
libboost_prg_exec_monitor.a python2.7
libboost_prg_exec_monitor.so R
Your system probably isn’t looking for the .so’s in this path.
Check /etc/ld.so.conf to see which directories are searched for so’s.
/usr/local is an odd location for those to be installed in. I’d expect /usr/lib or /usr/local/lib.
[EDIT to reflect new information]
Since you have installed boost in /usr/local/lib (I’m assuming all the .so’s are under there) and this path is already in /etc/ld.so.conf.d you can try running ldconfig:
Make sure you are compiling with the right libraries, e.g.: