dyld: Symbol not found: __cg_jpeg_resync_to_restart

一世执手 提交于 2019-12-03 10:41:01

问题


I'm trying to run a java version of PowerLoom, but when I try to start it in the terminal, I get the following error message:

dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Trace/BPT trap: 5

This seems like a very similar problem to this question, except that the answers are specific to MAMP/Cacti. Any tips on how to deal with this, or even what this error message really means?


回答1:


If using Qt Creator, you have to uncheck the Add build library search path to DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH option from the Run section in the Projects tab:




回答2:


You could try this in shell:

$ cd /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources

$ sudo ln -sf libJPEG.dylib /usr/local/lib/libJPEG.dylib

$ sudo ln -sf libPng.dylib /usr/local/lib/libPng.dylib

$ sudo ln -sf libTIFF.dylib /usr/local/lib/libTIFF.dylib

$ sudo ln -sf libGIF.dylib /usr/local/lib/libGIF.dylib



回答3:


This issue may be down to the application in question dynamically linking to the wrong version of the [libJPEG.dylib] library (it's also possible the correct version has been overwritten/modified). As explained in another question it is a problem that can occur when an application alters environment variables that control dynamic linking library location (e.g. On MacOS: DYLD_LIBRARY_PATH - more info see man dyld; On Linux: LD_LIBRARY_PATH - see man ld.so). It may be down to other factors such as dynamic link library config files but they have a system wide affect. You'll need to locate the variable setup in the application files and change it so that it prioritises the system paths e.g. (for MacOS):

export DYLD_LIBRARY_PATH=/usr/lib/:ADDITION_LIBRARY_PATH_LOCATION



回答4:


You likely have HomeBrew installed (or something like it). Something is setting DYLD_LIBRARY_PATH to /usr/local/lib first and you get a collision with Jpeg installed in /usr/local/lib/libJPEG.dylib instead of using the system version.

The (wrongly demoted) answer given by @Pierz above is correct.



来源:https://stackoverflow.com/questions/35509731/dyld-symbol-not-found-cg-jpeg-resync-to-restart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!