Boost logo

Boost :

Subject: [boost] linking on OSX
From: David M. Cotter (me_at_[hidden])
Date: 2009-10-09 17:35:18

i've compiled my boost library. i want to use threads in my stand-
alone application

i want this to work even on machines that don't have boost installed,

so i have a couple custom build steps in my XCode proj:

I have a "Copy Files" step which copies "libboost_thread.dylib" into
the "SharedSupport" folder of my application bundle
then the normal "link with binaries" step, which links with the
thread.dylib which is in the normal "install" location (/usr/local/lib/)
then i have a "custom shell script" step (after the linking step)
which does this:

install_name_tool -change libboost_thread.dylib @loader_path/../
SharedSupport/libboost_thread.dylib "${BUILT_PRODUCTS_DIR}/$

what this does is cause the executable to link with the
libboost_thread.dylib that is in the SharedSupport folder in the app
bundle, or so i thought.

because when i run, it fails to launch because it can't find the
dylib, i get this in the console:

10/9/09 2:19:35 PM [0x0-0x41d41d][88777] dyld: Library not
loaded: @loader_path/../SharedSupport/libboost_thread.dylib
10/9/09 2:19:35 PM [0x0-0x41d41d][88777] Referenced
from: /Users/davec/Desktop/
10/9/09 2:19:35 PM [0x0-0x41d41d][88777] Reason: no
suitable image found. Did find:
10/9/09 2:19:35 PM [0x0-0x41d41d][88777] /Users/davec/
unknown required load command 0x80000022

Boost list run by bdawes at, gregod at, cpdaniel at, john at