<xcode5代码运行在4.6上>-fobj-arc is not supported on platforms using the legacy runtime

-fobj-arc is not supported on platforms using the legacy runtime

这是在twitter上面的询问~

The Cocoanaut asked on Twitter:

“Does anybody know what this error means? (compiled on a white MacBook with 10.7.5 and Xcode 4.6.3)”

He attached this screenshot:  屏幕上显示如下:

-fobjc-arc not supported

I’ve been seeing this error quite often lately and so I’d like to document my answer for posteriority.

我已经看了这个错误很多次了,我今天就文档化这个问题的答案.


With each Xcode update it makes a few more or less helpful suggestions as to what settings you might be wanting to change. It saves the last Xcode version where it performed this check in the project file so that it will not bother you until the next Xcode update.

每一个版本的更新多少都有你想去改变的设置的建议在里面.当xcode检查更新并提示你的时候,如果你不想去更新,你可以保留你的版本/

Xcode 5 suggests to remove the Architectures setting. “This will remove the setting and allow Xcode to automatically select Architectures available for the active platform and deployment target”

Xcode 5建议删除架构设置。“这将删除设置,允许Xcode自动选择架构用于活动平台和部署目标”

Remove Architectures Setting

Of course we want the warning to go away so we let Xcode perform the changes. Thanks Xcode for helping me improve my project!

当然我们想去让xcode平台上面的警告消息到,感谢xcode帮助我们更好的完善程序

One change in the project is that the LastUpgradeCheck value gets set to 0500.

一个改变是  LastUpgradeCheck的改变.0500

LastUpgradeCheck

The second change is to remove the ARCHS setting from all build configurations.\

第二个变化是删除ARCHS设置构建配置。

Remove ARCHS

The warning is gone and we go on coding and debugging in Xcode 5 not suspecting that this change will be causing a problem on our build server.

警告没有了,但是我们在xcode5上编码和调试的时候将会导致 平台服务器的问题.

Build Server Fail

I performed this suggested update on several apps and projects but when the continuos integration build kicked in it suddenly started to fail. I opened the same project that I did the changes to capture the above screen shots in Xcode 4.6 and when trying to build it it fails:

我在几个应用程序和项目执行这个建议更新之处但当集成构建踢在它突然开始失败。我打开相同的项目,我做了上述变化来捕捉屏幕截图在Xcode 4.6和试图建立它失败时:

i386 PCH build failing

Hidden in the arguments for the ProcessPCH build step you can see that Xcode 4 seems to think that we would like to build this for i386 aka 32 bit.

隐藏在ProcessPCH构建步骤的参数可以看出,Xcode 4似乎认为我们想要构建这个i386即32位。

If you create a new Mac project from template then Xcode 4.6 set the ARCHS to$(ARCHS_STANDARD_64_BIT) aka “64-bit Intel”, regardless of the ARC setting. The default setting in Xcode 4.6 for ARCHS is $(ARCHS_STANDARD_32_64_BIT) aka “Standard (32/64-bit Intel” and this is also the value that Xcode 4.6 assumes you mean if the ARCHS setting is no longer present (because Xcode 5 removed it).

如果你从模板创建一个新的Mac项目然后运行Xcode 4.6 ARCHS(ARCHS_STANDARD_64_BIT)又名“英特尔64位”,不管弧设置。ARCHS的默认设置在Xcode 4.6(ARCHS_STANDARD_32_64_BIT)又名“标准(32/64-bit英特尔”,这也是价值Xcode 4.6假设你的意思如果ARCHS设置不存在了(因为Xcode 5删除它)。

32 Bit apps on Mac generally use the Objective-C 1.0 runtime, aka Legacy Runtime. This runtime version does not support ARC. Put differently, ever since you adopted ARC in your Mac apps you’ve been building for 64-bit only and now the removal of the ARCHS causes Xcode 4 to try and build for 32-bit as well.

32位的应用程序通常在Mac上使用objective - c 1.0运行时,即遗留运行时。这个运行时版本不支持弧。换句话说,自从你在Mac应用程序采用弧你已经建设了64位,现在的Xcode 4 ARCHS原因,试图构建32位。

On Xcode 5 the default value for Architectures has changed to $(ARCHS_STANDARD) aka “Standard Architectures (64-bit Intel) (x86_64)”. This is the reason why when building this Mac app with Xcode 5 you never see a problem, since it only tries to build for 64-bit.

在Xcode 5架构改变了美元的默认值(ARCHS_STANDARD)又名“标准架构(64位英特尔)(x86_64)”。这就是为什么在构建这个Mac app Xcode 5你从来没见过一个问题,因为它只对64位试图构建。

Conclusion

Getting any build message mentioning a legacy runtime means that your compiler is trying to build a combined 32- and 64-bit application. To fix that you’ll have to either restore the ARCHS to a value that only allows 64-bit output, or you update your Xcode to version 5.

得到任何构建消息提到遗留运行时意味着您的编译器试图建立一个联合32位和64位应用程序。修复,你必须恢复ARCHS的值只允许64位输出,或者你更新你的Xcode版本5。

You can do so without getting the upgrade warning, because the LastUpgradeCheck will remain on Version 5 and thus remain dormant until the next Xcode update.

你可以不升级警告,因为LastUpgradeCheck仍将版本5,从而保持休眠状态,直到下一个Xcode更新。


我2了,翻译到最后,结果是 一个是32位,一个是64位,我们要不重新加载代码,要不升级Xcode~~~满眼都是泪~

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值