How to build a dylib from several .o in Mac OS X using gcc
Use g++ -dynamiclib -undefined suppress -flat_namespace *.o -o something.dylib
Use g++ -dynamiclib -undefined suppress -flat_namespace *.o -o something.dylib
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
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
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
For some time I was thinking that this is my problem as well, but for normal apps (non-iOS-8-extension) you just need to change one build setting in your casual Xcode 6 iOS Universal Framework target (set Mach-O Type to Static Library): There should be no problem with iTunes Connect and iOS 7 after that 🙂
I’m not really disagreeing with DarkDust’s answer, but if I may channel my inner Bill Clinton, it depends on what the meaning of supported is 🙂 Apple doesn’t want you doing this for App Store apps, but the operating system certainly allows it. Jailbreak apps use this technique all the time. You basically use a … Read more
man 1 nm https://web.archive.org/web/20160316222941/https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/nm.1.html For example: nm -gU /usr/local/Cellar/cairo/1.12.16/lib/cairo/libcairo-trace.0.dylib
I’ve scoured Google but the only thing I can find so far is the following quote from the Apple developer forums: For those who are curious, the .tbd files are new “text-based stub libraries”, that provide a much more compact version of the stub libraries for use in the SDK, and help to significantly reduce … Read more
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