macos dyld:在终端中运行命令时库未加载错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2305802/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:46:33  来源:igfitidea点击:

dyld: Library not loaded error when running command in terminal

macosterminalosx-snow-leoparddylib

提问by denisjacquemin

When running some commands in the terminal, I get the following error message

在终端中运行某些命令时,我收到以下错误消息

dyld: Library not loaded: /opt/local/lib/libjpeg.62.dylib
  Referenced from: /opt/local//lib/libTIFF.dylib
  Reason: no suitable image found.  Did find:
    /opt/local//lib/libjpeg.62.dylib: can't map
    /opt/local/lib/libjpeg.62.dylib: can't map
Trace/BPT trap

My xcode is up to date.

我的 xcode 是最新的。

采纳答案by user151019

As your paths begin /opt/local I assume you are using macports

当您的路径开始时 /opt/local 我假设您正在使用macports

If so I think you need to at least do a sudo port selfupdate as the current tiff port depends on /libjpeg.7.dylib.

如果是这样,我认为您至少需要执行 sudo 端口 selfupdate,因为当前的 tiff 端口取决于 /libjpeg.7.dylib。

Possible a complete reinstall is needed if the macports was installed under Leopard or earlier

如果 macports 是在 Leopard 或更早版本下安装的,则可能需要完全重新安装

回答by bpaul

After you do your

在你做完你的

sudo port selfupdate 

don't forget to do a

不要忘记做一个

sudo port upgrade outdated

to upgrade your existing ports. Much better than reinstalling everything :-)

升级您现有的端口。比重新安装所有东西要好得多:-)

回答by Simon Michael

On my Leopard machine using macports, libsdl_imagewas looking for this non-installed jpeg lib. The jpeg6bport includes it, but at a different path (/opt/local/lib/jpeg6b/lib/libjpeg.62.dylib). I fixed it by doing

在我使用 macports 的 Leopard 机器上,libsdl_image正在寻找这个未安装的 jpeg 库。所述jpeg6b端口包括它,但在不同的路径(/opt/local/lib/jpeg6b/lib/libjpeg.62.dylib)。我通过做修复了它

port selfupdate
port install libsdl_image

which upgraded libsdl_image from 1.2.8_0 to 1.2.10_2 and made the problem go away.

它将 libsdl_image 从 1.2.8_0 升级到 1.2.10_2 并使问题消失。

回答by Simon Paarlberg

I had the same problem. I have never runned anything else than Snow Leopard. I have tried all kind of stuff and used about 10 hours trying to fix this problem, but with no success.

我有同样的问题。除了雪豹,我从来没有跑过其他任何东西。我尝试了各种方法并用了大约 10 个小时试图解决这个问题,但没有成功。

I ended up removing macports completely and installed it again.

我最终完全删除了 macports 并重新安装了它。

This is what I did:

这就是我所做的:

First I got a list of all my installed ports:

首先,我得到了所有已安装端口的列表:

> port installed

Then I uninstalled everything:

然后我卸载了所有东西:

> sudo port -f uninstall installed

And installed macports again: macportsand installed all my packages again.

并再次安装 macports:macports并再次安装我的所有软件包。

It was rather tedious, but it did the trick.

这是相当乏味的,但它做到了。