Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Dynamic libs (dylibs) on OSX bake in the path that they should be loaded from. For example...</p> <p><code>/usr/lib/some_awesome.dylib</code>. </p> <p>When you link to a dylib, the linker embeds this path in your executable as the place to look for it at runtime. This is fine and easy with installed libs, but for relative path linking it's more complicated.</p> <p>When you build the boost libs, they just get their names embedded rather than a full or relative path (i.e. <code>libboost_system.dylib</code> rather than <code>/usr/lib/libboost_filesystem.dylib</code>). You should be able to change this with the <code>dll-path</code> <a href="http://www.boost.org/boost-build2/doc/html/bbv2/overview/builtins/features.html" rel="noreferrer">option</a>, but <a href="http://lists.boost.org/boost-build/2009/10/22611.php" rel="noreferrer">that seems broken currently</a>.</p> <p>To fix your problem you either need to get the correct path relative to your application embedded (e.g. <code>@executable_path/libwhatever.dylib</code>) into the dylibs somehow, which would probably require the bjam dll-path option to work, or instead you can fix your executable to look in a different location. </p> <p>To do this, use something like the following as a script step in your build:</p> <p><code>install_name_tool -change libboost_filesystem.dylib @executable_path/libboost_filesystem.dylib$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH</code></p> <p>Note that if you have multiple dylibs that reference each other with broken paths, you'll need to fix the paths between them too, e.g.</p> <p><code>install_name_tool -change libboost_system.dylib @executable_path/libboost_system.dylib$BUILT_PRODUCTS_DIR/$EXECUTABLE_FOLDER_PATH/libboost_filesystem.dylib</code></p> <p>The following is a good article on this: <a href="http://qin.laya.com/tech_coding_help/dylib_linking.html" rel="noreferrer">Creating working dylibs</a></p>
 

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