尽pipe只恢复到32位体系结构,但仍然在Xcode 5.1上发生链接器错误

因为我更新到Xcode 5.1,这改变了标准体系结构也包括arm64 ,我不断从链接器得到以下错误:

 0 0x109157f93 __assert_rtn + 144 1 0x1091faed4 ld::passes::stubs::Pass::makeStub(ld::Atom const&, bool) + 0 2 0x1091fb5f7 ld::passes::stubs::Pass::process(ld::Internal&) + 497 3 0x1091fbc07 ld::passes::stubs::doPass(Options const&, ld::Internal&) + 111 4 0x109158b50 main + 772 5 0x7fff8568b5fd start + 1 A linker snapshot was created at: /tmp/MyApp-2014-02-19-175731.ld-snapshot ld: Assertion failed: (target != NULL), function stubableFixup, file /SourceCache/ld64/ld64-236.3/src/ld/passes/stubs/stubs.cpp, line 126. clang: error: linker command failed with exit code 1 (use -v to see invocation) 

鉴于我使用的第三方库只为armv7编译,我试图设置体系结构和有效的体系结构选项,只包括armv7,在项目和目标的构build设置,但我不断收到错误,即使在清洗…任何想法?

谢谢!

解决scheme(相反),在我的情况下,是在生成设置的链接部分禁用Dead Code Strippingfunction。

Xcode 5.1似乎有一个关于这个function和Link Time Optimization (我已经设置为NO )的错误。

更多信息可以在这里find: https : //devforums.apple.com/message/950372#950372

编辑(2014-04-18):

这个问题似乎是从Xcode 5.1.1开始解决的,因为将Dead Code Stripping标志返回到Yes不会再导致链接错误。

我刚刚对我的一个应用程序发出了同样的错误信息,唯一能解决这个问题的就是将连接时间优化更改为否。

刚刚遇到同样的错误,

你想要做的是转到项目构build设置,并将“仅构build主动架构”设置为debugging以及发布。 。 。

这会让你去:-)

我希望这个问题不是太遥远,但是值得注意的是,升级Xcode之后可以保留旧的SDK。 在升级之前备份以下文件夹的内容并不是一个坏主意:

 $(xcode-select --print-path)/Platforms/*/Developer/SDKs 

升级后可以将旧的SDK复制回来。 显然, 尽可能使用最新的SDK更好 ,但是有时候最后期限和开发实际情况使得继续使用可用的SDK,直到代码可以被重新使用。

这个过程也可以半自动执行。 只需在新的位置安装最新的Xcode版本(保持旧版本不变),并使用以下脚本链接现有的SDK:

 platforms_path="$1/Contents/Developer/Platforms"; if [ -d $platforms_path ]; then for platform in `ls $platforms_path` do sudo ln -sf $platforms_path/$platform/Developer/SDKs/* $(xcode-select --print-path)/Platforms/$platform/Developer/SDKs; done; fi; 

您只需要提供旧的.app的path即可:

 ./xcode.sh /Applications/Xcode-463.app 

这个问题的更多信息:

  • 是否可以在Xcode 5上安装iOS 6 SDK?

你可以在这里find旧版本的Xcode: