How to solve linker dependencies on Mac OS X

I got the following error message when compiling a code, even though I’d already passed the correct include/library paths.

dyld: Library not loaded: libboost_filesystem.dylib
Referenced from: /Users/kunigami/dev/osl/build/macosx/shaders/../oslc/oslc
Reason: image not found

This happend because I built boost from source and kept it local. Thus the path to the library was not the default one. To solve this problem we have to edit the environment variable DYLD_LIBRARY_PATH, which is analogous to linux LD_LIBRARY_PATH:

export DYLD_LIBRARY_PATH=/Users/kunigami/dev/boost/lib:$DYLD_LIBRARY_PATH

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s