My Place

Simple thoughts

RPath and Dylibs a Fustrating Tale

This is the true story of how Dylibs caused me pain, here is the totally unhappy error I got.

dyld: Library not loaded: /usr/local/lib/libct.4.dylib
   Referenced from: Blah blah blah
Reason: image not found

I chased this down for the better part of the hour until coming across some information on install_name_tool, you can find more details about the tool here. To find out the basic command I used with @rpath I used.

install_name_tool -id "@rpath/../Frameworks/libsybdb.5.dylib" libsybdb.5.dylib

Then in my application I had to add the @rpath to the Runtime Search Paths

@loader_path/../Frameworks

After I setup all my dylibs like this my application runs once again. Oddly enough my application ran smoothly for a while during development but I did a brew update and I can only guess it wiped out the libraries I was using. I was surprised. Seems somewhat archaic to my day job of Java and .NET. So if for some reason a google search turns up this error and saves someone my pain then it is all worth its.