Search code examples
macosopenglosx-mountain-lionscons

dyld: Symbol not found: _jpeg_resync_to_restart


I'm trying to run a simple OpenGL tutorial for my class, but the C++ code was made to run for Windows and Linux. I'm trying to make it run under Mac OS X Mountain Lion. I found the proper library headers, it now compiles OK (with scons), but the build gives this error when run:

dyld: Symbol not found: _jpeg_resync_to_restart
  Referenced from: /usr/local/lib/libIL.1.dylib
  Expected in: flat namespace
in /usr/local/lib/libIL.1.dylib
Trace/BPT trap: 5

Searching online gave me nothing but python imaging library problems. I have a libjpeg and DevIL installed through homebrew.


Solution

  • Judging from the Google searches, the built-in libjpeg library in Mac OS X has the __cg_jpeg_resync_to_restart while if you use MacPorts, Fink, or maybe compile it yourself you get - _jpeg_resync_to_restart. In this case the DevIL library, gotten through Homebrew was searching for the symbol not coming from the Mac OS X library, so I assumed that I should install libjpeg through homebrew. However it turns out that libjpeg was already installed through homebrew. So I guessed that maybe there were problems with the linking of libjpeg, I unlinked and linked again, and yes there were problems with the initial linking of the library. However this did not seam to solve the problem. I again made the assumption that now that the libjpeg has symbolic links at the right places if I built the DevIL library again it will link against the proper library at the proper place. So I did a brew uninstall devil and then brew install devil which compiled with from source again. Aaand voila :)