简体   繁体   English

如何让Xcode 3.2.3构建一个特定的架构?

[英]How to make Xcode 3.2.3 build a specfic architecture?

I'm getting the following error when including static libraries: 包含静态库时,我收到以下错误:

missing required architecture i386 in file 在文件中缺少必需的体系结构i386

This worked 30 seconds previously, and only failed when I upgraded to Xcode 3.2.3. 这之前工作了30秒,并且在我升级到Xcode 3.2.3时失败了。 I've used "file" command to check - and, yes, XCode is building completely the wrong architecture (armv6 + armv7 instead of i386). 我使用“file”命令来检查 - 是的,XCode正在构建完全错误的架构(armv6 + armv7而不是i386)。

This seems to be a major bug in latest Xcode, where Apple has re-written the build / compile / link settings. 这似乎是最新Xcode中的一个主要错误,Apple重新编写了构建/编译/链接设置。 There's a note in the release notes saying very vaguely that they've "Changed it" because it used to be "confusing". 在发行说明中有一个注释非常含糊地说它们“改变了它”,因为它曾经“混乱”。 This is not helpful. 这没用。

The build settings for the library VERY clearly say: 图书馆的构建设置很清楚地说:

"Valid architectures: i386" “有效的架构:i386”

There's no confusion here - Xcode is building something other than what the target says it should. 这里没有混淆--Xcode正在构建一些目标,而不是目标所说的东西。

The question is: how do you un-break this? 问题是:你怎么解开这个? How do you force Xcode to do what it's supposed to? 你如何强迫Xcode做它应该做的事情? I've re-installed Xcode from scratch, cleaned everything, and manually inspected the build files. 我从头开始重新安装了Xcode,清理了所有内容,并手动检查了构建文件。 There's nothing wrong (and, of course, it worked perfectly in xcode 3.2.2) 没有什么不对(当然,它在xcode 3.2.2中完美运行)

After considerable research, I believe the answer is: 经过大量研究,我相信答案是:

"this is now impossible - Apple has deliberately hard-coded XCode to ignore build settings" “现在这是不可能的 - 苹果故意硬编码XCode忽略构建设置”

However, I've come up with a script that automatically builds ALL platforms of a project (which you HAVE to do with static libraries - you don't have much choice now, because Apple has disabled Targets), and the script could easily be modified to do all targets, instead of all platforms: 但是,我想出了一个脚本,可以自动构建项目的所有平台(你必须使用静态库 - 你现在没有太多选择,因为Apple已经禁用了目标),脚本很容易就可以了修改为执行所有目标,而不是所有平台:

Build fat static library (device + simulator) using Xcode and SDK 4+ 使用Xcode和SDK 4+构建胖静态库(设备+模拟器)

右键单击Targets下的Target应用程序,确保Base SDK设置为iOS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM