格式错误的mach-o图片:符号表不足__LINKEDIT [英] malformed mach-o image: symbol table underruns __LINKEDIT
问题描述
使用基于macOS Sierra GM的新Xcode 8 GM,我重新编译了一个Qt 5.7 C ++项目,并且在尝试启动该应用程序时收到以下错误消息:
Using the new Xcode 8 GM build on the GM of macOS Sierra, I've recompiled a Qt 5.7 C++ project and I'm getting the following error message when trying to launch the app:
原因:未找到合适的图像.找到了:
Reason: no suitable image found. Did find:
/path/to/my/lib/libio_core.dylib: 格式错误的mach-o图片:符号表不足__LINKEDIT
/path/to/my/lib/libio_core.dylib: malformed mach-o image: symbol table underruns __LINKEDIT
这在调试版本中不会发生,只能发布.有谁知道这意味着什么以及如何解决它?
This doesn't occur on debug builds, only release. Does anyone have an idea as to what this means and how to go about fixing it?
更新:
这实际上与Xcode 8无关.使用Xcode 7.3.1构建相同的代码会得到相同的结果.似乎某些在El Capitan上运行良好的应用无法在Sierra上运行,并因上述错误而失败.
This actually has nothing to do with Xcode 8. Building the same code with Xcode 7.3.1 results in the same outcome. It seems some apps that ran just fine on El Capitan won't run on Sierra and fail with the above error.
更新2:有关我的二进制文件中符号表的详细信息:
Update 2: Details about the symbol table in my binary:
Load command 5
cmd LC_SYMTAB
cmdsize 24
symoff 0
nsyms 0
stroff 12760
strsize 8
推荐答案
原来是由Qt
引起的.在库上执行install
任务时,Qt 5.7.0
会不带任何参数地调用strip
.对于macOS Sierra
,这将导致dylib
的符号表为空.
Turns out this was caused by Qt
. Qt 5.7.0
calls strip
with no arguments when performing the install
task on libs. With macOS Sierra
this results in a dylib
with an empty symtab.
此错误将在Qt 5.7.1
中修复.同时,只需确保您为动态库调用strip
和-S -x
即可.
This bug will be fixed in Qt 5.7.1
. In the meantime, just make sure you call strip
with -S -x
for dynamic libraries.
这篇关于格式错误的mach-o图片:符号表不足__LINKEDIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!