Hi John,
On 2012-02-03 3:12 PM John Brownie wrote:
I tried installing Bibledit on my Mac with 10.7.3, and ran into a
library conflict when trying to start X11. Basically, there seem to
be two JPEG libraries, the one installed with MacPorts in
/opt/local/lib and the one in the system framework ImageIO. Somehow
the library search order is wrong, looking for a routine in ImageIO
in /opt/local/lib and failing:
Dyld Error Message:
Symbol not found: __cg_jpeg_resync_to_restart
Referenced from:
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /opt/local/lib/libJPEG.dylib
in
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
I looked around for a bit and my understanding of the problem is as
follows:
The main library in ImageIO.framework references libJPEG.dylib
libJPEG.dylib exists as a private library of ImageIO.framework
libjpeg.dylib also exists in /opt/local/lib
HFS+ is case-insensitive (by default) so these are considered the same
ImageIO's private build of libjpeg prepends _cg_ to all the library
function names
The standard libjpeg has the function name without the _cg_
The standard libjpeg is loaded but doesn't have the function ImageIO
is referencing
It may be possible to find a work-around by fiddling with library
search paths, but I'm not sure how or where to do that.
Unfortunately, if you were to change the search order so that
ImageIO's libJPEG is loaded instead, anything that needs the functions
from the standard version won't be able to access them. So this is a
no-win situation.
The same problem came up when I was trying to install mono for
getting FieldWorks to try to compile, so it's not just Bibledit that
has the problem. Hence the cross-post to Collaborate Forum.
It seems to me that Bibledit may not need the MacPorts libjpeg, and
it's there only because of the work you did with FieldWorks. You could
try deactivating the jpeg port. which would hide the library, and
Bibledit might then work.
If this doesn't work, you would have to do something to ensure the two
libraries have different names. Renaming the ones in ImageIO is
definitely risky, but maybe you could do something with the MacPorts
one. For example, /opt/local/lib/libjpeg.dylib is just a symlink to
libjpeg.8.dylib, and it could be that many things would still work if
you removed the symlink, since they actually refer to libjpeg.8.dylib.
If Apple is going to use private versions of open-source libraries,
they should really give them different names, not just rename the
functions.
--Neil