How to use dylib in Mac OS X (C++)

After reading the link that Justin provided, I was successfully able to use the @executable_path token to change my dylib install_name to point to the same dir where my executable is located. @executable_path Absolute paths are annoying. Sometimes you want to embed a framework into an application instead of having to install the framework into … Read more

Brew doctor: dyld: Library not loaded & Error: No available formula for zlib

Try to re-install libtool by: brew reinstall libtool –universal && brew unlink libtool && brew link libtool If that doesn’t help, try removing libtool completely, and then retry the steps above: brew uninstall libtool If it still doesn’t work after trying the steps above, check to see if you have the DYLD_FALLBACK_LIBRARY_PATH variable defined somewhere … Read more

install_name_tool to update a executable to search for dylib in Mac OS X

From otool -l, I analyzed what should be added or modified from the original library and binary. Dylib The change is in id: Load command 2 <– OLD cmd LC_ID_DYLIB cmdsize 40 name libtest.dylib (offset 24) time stamp 1 Wed Dec 31 18:00:01 1969 Load command 2 <– NEW cmd LC_ID_DYLIB cmdsize 64 name @loader_path/../lib/libtest.dylib … Read more

dyld: Library not loaded … Reason: Image not found

Find all the boost libraries (where exefile is the name of your executable): $ otool -L exefile exefile: @executable_path/libboost_something.dylib (compatibility version 0.7.0, current version 0.7.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) and for each libboost_xxx.dylib, do: $ install_name_tool -change @executable_path/libboost_something.dylib /opt/local/lib/libboost_something.dylib exefile and finally verify using otool … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)