Dyld: library not loaded: libboost_system.dylib

Another dyld: Library not loaded problem dyld: Library not loaded dylib.

I have dylib ( libboost_system.dylib ) compiled from Boost sources,
then used install-name-tool to prepare it for inclusion in the Frameworks folder of my application package as follows:

 install_name_tool -id @executable_path /../Frameworks/ libboost_system.dylib libboost_system.dylib 

Confirmed with otool :

 $> otool -L libboost_system.dylib /Users/TesterCodeSandbox/OgreSDK /BOOST_DYLIBS/libboost_system.dylib: @executable_path/../Frameworks /libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) 

Now added the Xcode project associated with the application and copied to the Frameworks folder.
But when checking the embedded application with otool -L it still refers to the original (i.e. Unmoved) dylib:

 OgreTest-ekeeqmnyciddaxbzyrehtcoijcki/Build /Products/Debug/OgreTest.app/Contents/MacOS/OgreTest: @executable_path/../Plugins /RenderSystem_GL.dylib (compatibility version 0.0.0, current version 1.8.0) /System/Library/Frameworks/Cocoa.framework/ Versions/A/Cocoa (compatibility version 1.0.0, current version 15.0.0) @executable_path/../Frameworks/Ogre.framework/ Versions/1.8.0/Ogre (compatibility version 0.0.0, current version 1.8.0) @executable_path/../Frameworks/Cg.framework /Cg (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/IOKit.framework/Versions/A /IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A /Carbon (compatibility version 2.0.0, current version 152.0.0) libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0) /System/Library/Frameworks/CoreFoundation.framework /Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.43.0) /System/Library/Frameworks/AppKit.framework /Versions/C/AppKit (compatibility version 45.0.0, current version 1038.36.0) 

And the application does not start with the error dyld: Library not loaded: libboost_system.dylib . Any ideas?


Note 1

Now it works if I also processed my install_name_tool application binary file , i.e.

install_name_tool -change libboost_system.dylib @executable_path/../Frameworks/libboost_system.dylib TestApp

Am I missing any Xcode option to force the compiler to automatically change the location of dylib in my application as part of the assembly?

Of course, calling install_name_tool manually for a consuming application, dylib (i.e., one of potentially many) can be just a workaround for something that I messed up when setting up a project (application) ....

+4
source share

All Articles