Clashing OSX frameworks

If you’ve ever compiled your own LibJPEG then perhaps you’ve come across this error, or something like it:

dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from:
Expected in: /path/to/your/libJPEG.dylib

I struggled with this yesterday after running OSX software update. I couldn’t log in to my account.

The solution is to move any of the libraries that you’ve installed yourself that are also referenced in the


path, namely libGIF, libJP2, libJPEG, libOpenEXR, libPng, libRadiance and libTIFF, into the DYLD_FALLBACK_LIBRARY_PATH env variable instead of DYLD_LIBRARY_PATH.

Apparently, DYLD_FALLBACK_LIBRARY_PATH will look in the place you’ve specified first then fallback to looking in system libraries.

My ~/.zprofile (or if you’re on bash, ~/.bash_profile) now looks like this:


Be sure to look for anywhere you may have these env vars set. I also had to change them in the ~/.MacOSX/environment.plist before I could access my account again.

Added on:
Last updated:
Info:- OSX versions 10.4 (Tiger), 10.5 (Leopard), 10.6 (Snow Leopard) - yes, this happened to me on each of these versions!