Since I don't have root permission to install Boost C++ library, I installed it under my home local. When compiling, I used:
g++ -I/home/name/local/boost_1_47_0 -L/home/name/local/boost_1_47_0/stage/lib foo.cc -o foo -lboost_program_options
but at runtime, it goes:
error while loading shared libraries: libboost_program_options.so.1.47.0: cannot open shared object file: No such file or directory
and ldd gives:
libboost_program_options.so.1.47.0 => not found
I also tried to specify the absolute path of the library, but it doesn't work either:
g++ /home/name/local/boost_1_47_0/stage/lib/libboost_program_options.so.1.47.0 -I/home/name/local/boost_1_47_0 -L/home/name/local/boost_1_47_0/stage/lib foo.cc -o foo