How to check where you library wants to live:
$ otool /pathToLib/lib.dylib
How to tell your app to get the lib from another path:
$ install_name_tool -change /pathLibWantsToBe/lib.dylib /pathYouNeed/lib.dylib /pathToApp/AppName.app/Contents/MacOS/AppName
Let's say you want the lib to be embedded in your app (supposing you're using XCode):
- add the library to your project (drag it in
Frameworks/BuildPhases -> Link Binary With Libraries) - Go to
BuildPhases -> CopyFiles, setDestinationtoFrameworksand add the library to the list. This will copy it to theFrameworksfolder in your bundle. - In
BuildPhases -> RunScriptadd: