Whenever I build simple C++ programs using Boost Python, I always have to manually go in and change the path to whichever boost libraries I executed the build with using the following command:
install_name_tool -change [old_boost_library_path] [new_boost_library_path] foo.cpp
Which prevents me from running into any Library not loaded: [boost_library]
errors.
However, as you can imagine, it gets tedious having to go in and manually change the location of each incorrectly referenced boost library path (especially when dealing with several libraries).
So my question is. Is there any way to change the path of the boost libraries being used in the build during the build, so I don't have to do this after? As this would save me a lot of time and typing.
In my Makefile I have set a variable to include the needed libraries, similar to:
LD_LIBS=-L/boost_1_62_0/stage/lib -lboost_python3 -lboost_system -L/Library/Frameworks/Python.framework/Versions/3.5/lib -lpython3.5m
The output of running otool -L foo.cpp
is:
Foo.cpp:
libboost_python3.dylib (compatibility version 0.0.0, current version 0.0.0)
libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0)
/Library/Frameworks/Python.framework/Versions/3.5/Python (compatibility version 3.5.0, current version 3.5.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
The path to the above boost libraries should be /boost_1_62_0/stage/lib/[library_name]
not [library_name]
.
Is this fixable? Any help would be appreciated.