0

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.

user1438832
  • 493
  • 3
  • 10
  • What does `ls /Users/rohitsingh/Obj/Boost_Test/boost_1_63_0/installation/lib/libboost_filesystem*` tell you? – John Zwinck May 01 '17 at 04:42
  • /Users/Abc/Obj/Boost_Test/boost_1_63_0/installation/lib/libboost_filesystem.a /Users/Abc/Obj/Boost_Test/boost_1_63_0/installation/lib/libboost_filesystem.dylib – user1438832 May 01 '17 at 04:51

0 Answers0