TL DR
The Objective-C application is linked to the static library that dynamic links Boost Filesystem. An application can be launched from the output directory using the terminal, but trying to start from the Xcode or Finder debugger gives the error dyld: Library not loaded: libboost_filesystem.dylib <snip> Reason: image not found .
Problem
In my Xcode project, I have a structure that looks like this:
MainProject (Objective-C) - static_lib_that_uses_filesystem (C++)
To get everything connected, I added libboost_system and libboost_filesystem dylibs to the build phase of Link Binary with Libraries in MainProject.
When I try to run the application from Xcode or Finder, I get:
sharedlibrary apply-load-rules all warning: Unable to read symbols for libboost_filesystem.dylib (file not found). warning: Unable to read symbols from "libboost_filesystem.dylib" (not yet mapped into memory). warning: Unable to read symbols for libboost_system.dylib (file not found). warning: Unable to read symbols from "libboost_system.dylib" (not yet mapped into memory). [Switching to process 43957 thread 0x0] dyld: Library not loaded: libboost_filesystem.dylib Referenced from: /Users/ssteele/Library/Developer/Xcode/DerivedData/MainProject-dqrhyuarllykslftblocjdzxlran/Build/Products/Debug/MainProject.app/Contents/MacOS/MainProject Reason: image not found
I added a build step to copy dylib to the bundled Frameworks directory, this will not help. I changed this to copy them to the "Executables" directory, which also did not help.
The presence in the "Executable files" directory allows me to run the application from the terminal.
How can I get the dylib search application when starting from Finder / Xcode?
Background Information
I am using Xcode 4.2 on Lion and currently only target Lion. I created my shared libraries for the file system as follows:
./b2 threading=multi macosx-version=10.7 --with-filesystem stage
This creates libboost_system.dylib, libboost_filesystem.dylib, as well as .a equivalents in the stage / lib directory, I refer to them directly in the project.