xcode install_name_tool 报告格式错误的对象

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10390186/
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-09-15 00:08:54  来源:igfitidea点击:

install_name_tool reporting malformed object

xcodeosx-snow-leopardinstall-name-tool

提问by McLeary

Everytime I try to use install_name_tool on my machine it reports the following

每次我尝试在我的机器上使用 install_name_tool 时,它都会报告以下内容

install_name_tool: object: Abacate malformed object (unknown load command 4)

I read that it could be an error when building the binary. In order to check I create the simplest hello world c++ program and try to change something using install_name_tool. Didn't work. What Am I doing wrong?

我读到构建二进制文件时可能会出错。为了检查我创建了最简单的 hello world c++ 程序并尝试使用 install_name_tool 进行更改。没用。我究竟做错了什么?

Currently I have XCode 4.2 running Snow Leopard OS.

目前我有运行雪豹操作系统的 XCode 4.2。

回答by Maarten O.

Apparently install_name_tool is not updated when XCode is updated. You need to install the Command Line Tools from XCode Preferences. See also install_name_tool on OS X Lion. This resolved the same error for me.

显然 install_name_tool 在 XCode 更新时没有更新。您需要从 XCode 首选项安装命令行工具。另请参阅OS X Lion 上的 install_name_tool。这为我解决了同样的错误。

回答by trigas

Managed to make it work with Mac OS 10.9.3

设法使其适用于 Mac OS 10.9.3

https://github.com/Homebrew/homebrew/issues/26544

https://github.com/Homebrew/homebrew/issues/26544

$$:~ otool -L /usr/bin/install_name_tool

$$:~ otool -L /usr/bin/install_name_tool

/usr/bin/install_name_tool: /usr/lib/libxcselect.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

/usr/bin/install_name_tool: /usr/lib/libxcselect.dylib(兼容版本 1.0.0,当前版本 1.0.0) /usr/lib/libSystem.B.dylib(兼容版本 1.0.0,当前版本 1197.1.1 )

$$:~ pkgutil --file-info /usr/bin/install_name_tool

$$:~ pkgutil --file-info /usr/bin/install_name_tool

volume: / path: /usr/bin/install_name_tool pkgid: com.apple.pkg.Essentials pkg-version: 10.9.0.1.1.1306847324 install-time: 1390577801 uid: 0 gid: 0 mode: 755

卷:/路径:/usr/bin/install_name_tool pkgid:com.apple.pkg.Essentials pkg-version:10.9.0.1.1.1306847324 安装时间:1390577801 uid:0 gid:0 模式:755

No more errors on wget:

wget 不再有错误:

$$:~ wget dyld: Library not loaded:

@@HOMEBREW_PREFIX@@/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /usr/local/bin/wget Reason: image not found

$$:~ wget dyld: 库未加载:

@@HOMEBREW_PREFIX@@/opt/openssl/lib/libssl.1.0.0.dylib 引用自:/usr/local/bin/wget 原因:找不到图像