XQuartz动态加载错误
我更新了 XQuartz,现在它无法加载,并抱怨:
Dyld Error Message:
Library not loaded: /opt/X11/lib/libfreetype.6.dylib
Referenced from: /Applications/Utilities/XQuartz.app/Contents/MacOS/X11.bin
Reason: Incompatible library version: X11.bin requires version 14.0.0 or later, but libfreetype.6.dylib provides version 13.0.0
但是,如果我 otool -L /opt/X11/lib/libfreetype.6.dylib
:
/opt/X11/lib/libfreetype.6.dylib:
/opt/X11/lib/libfreetype.6.dylib (compatibility version 14.0.0, current version 14.2.0)
...
那么该库是正确的版本!
什么可能导致此错误?
I updated XQuartz, and now it doesn't load, complaining that:
Dyld Error Message:
Library not loaded: /opt/X11/lib/libfreetype.6.dylib
Referenced from: /Applications/Utilities/XQuartz.app/Contents/MacOS/X11.bin
Reason: Incompatible library version: X11.bin requires version 14.0.0 or later, but libfreetype.6.dylib provides version 13.0.0
However, if I otool -L /opt/X11/lib/libfreetype.6.dylib
:
/opt/X11/lib/libfreetype.6.dylib:
/opt/X11/lib/libfreetype.6.dylib (compatibility version 14.0.0, current version 14.2.0)
...
So the library is the right version!
What could cause this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此类错误是由用户在其环境中设置 DYLD_LIBRARY_PATH 引起的。这可能在 /etc/launchd.conf、/etc/profile、/etc/bashrc、~/.profile、~/.bashrc、~/.bash_profile 或类似文件中完成。
DYLD_LIBRARY_PATH 包含一个目录,其中包含名为 libfreetype.6.dylib 的文件,该文件用于代替 XQuartz 中包含的文件。
无论是谁建议您设置 DYLD_LIBRARY_PATH ,都可能是错误的。它应该只在非常特殊的情况下使用,例如在开发环境中。它几乎不应该在运输产品中使用,也不应该在 shell 环境中设置为一般解决方法。
Errors like this are caused by users setting DYLD_LIBRARY_PATH in their environment. This is likely done in either /etc/launchd.conf, /etc/profile, /etc/bashrc, ~/.profile, ~/.bashrc, ~/.bash_profile, or similar.
DYLD_LIBRARY_PATH included a directory that contained a file named libfreetype.6.dylib which was used instead of the one included with XQuartz.
Whoever gave you the recommendation to set DYLD_LIBRARY_PATH likely did so in error. It should only be used in very specific cases, such as in development environments. It should almost never be used in shipping products and never set as a general workaround in your shell environment.