Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I get Xcode to link and debug an app with Boost Filesystem?
    primarykey
    data
    text
    <p><strong>TL;DR</strong></p> <p>Objective-C app linked with static library that dynamic links Boost Filesystem. App can be run from output directory using Terminal, but trying to run from Xcode debugger or Finder gives error <code>dyld: Library not loaded: libboost_filesystem.dylib &lt;snip&gt; Reason: image not found</code>.</p> <p><strong>Problem</strong></p> <p>In my Xcode project I have a structure that looks like this:</p> <pre><code>MainProject (Objective-C) - static_lib_that_uses_filesystem (C++) </code></pre> <p>To get everything to link, I added libboost_system and libboost_filesystem dylibs to the "Link Binary with Libraries" build phase in MainProject.</p> <p>When I try to run the app from either Xcode or Finder I get:</p> <pre><code>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 </code></pre> <p>I added a build stage to copy the dylibs to the Frameworks directory in the bundle, this doesn't help. I changed this to copy them to the Executables directory which also didn't help.</p> <p>Having them in the Executables directory <em>does</em> allow me to run the app from Terminal.</p> <p>How can I get the app to find the dylibs when run from Finder/Xcode?</p> <p><strong>Background Info</strong></p> <p>I'm using Xcode 4.2 on Lion and currently targeting Lion only. I built my shared libraries for filesystem like this:</p> <pre><code>./b2 threading=multi macosx-version=10.7 --with-filesystem stage </code></pre> <p>This creates libboost_system.dylib, libboost_filesystem.dylib, and also .a equivalents in the stage/lib directory, I'm referencing them in the project directly from there.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload