Hi a am learning boostfilesystem.I have a testcode and i have build it using command -
g++ -std=c++11 -I//Boost_Test/boost_1_63_0/installation/include -L/Boost_Test/boost_1_63_0/installation/lib/ test.cpp -Bstatic -lboost_filesystem -lboost_system
But when i run it using command
./a.out
i get the error as - dyld: Library not loaded: libboost_filesystem.dylib Referenced from: /Users/Abc/Obj/./a.out Reason: image not found
But when i run it like -
DYLD_LIBRARY_PATH=/Boost_Test/boost_1_63_0/installation/lib ./a.out
it is working.
My Question is if i have linked it statically using -Bstatic option why it is not linked statically.Why i have to give shared library path to run it.