xcode 为架构“armv7”选择了不受支持的编译器“GCC 4.2”

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

Unsupported compiler 'GCC 4.2' selected for architecture 'armv7'

iphoneiosxcode

提问by iOSDev

Just installed new version XCode 4.2 onto my Mac. I tried compiling my project but got the following error:

刚刚在我的 Mac 上安装了新版本的 XCode 4.2。我尝试编译我的项目,但出现以下错误:

Unsupported compiler 'GCC 4.2' selected for architecture 'armv7'

为架构“armv7”选择了不受支持的编译器“GCC 4.2”

Tried selecting arm7 in drop down for architechture in project and target settings. (The list actually shows just arm 7) still no use.

尝试在项目和目标设置中的架构的下拉列表中选择 arm7。(列表中实际上只显示了 arm 7)仍然没有用。

Please help.

请帮忙。

Thanks

谢谢

回答by Saurabh Passolia

you should actually select the LLVM compiler under "Compiler Version" instead of trying to set "Valid Architectures"

您实际上应该在“编译器版本”下选择 LLVM 编译器,而不是尝试设置“有效架构”

回答by sinh99

xcode build errors:

xcode 构建错误:

Unsupported compiler ‘GCC 4.2′ selected for architecture ‘i386′

Solution:

解决方案:

This can be caused by importing a project for a pre- iOS 5 SDK into a copy of xcode with iOS 5 SDK only.

这可能是由于将 iOS 5 SDK 之前的项目导入到仅带有 iOS 5 SDK 的 xcode 副本中造成的。

To fix, click your

要修复,请单击您的

Project -> Build Settings.  

Then under Build Options, there is an entry for Compiler for C/C++/Objective-C. Choose Apple LLVM compiler 3.0.

然后在 Build Options 下,有一个 Compiler for C/C++/Objective-C 条目。选择 Apple LLVM 编译器 3.0。

There is a chance this could effect other aspects of your binaries as you are using a new compiler, so YMMV. That being said, it's so far caused no issues for me.

当您使用新的编译器时,这可能会影响二进制文件的其他方面,所以 YMMV。话虽如此,到目前为止它对我没有造成任何问题。

回答by Alex Stone

If you have multiple projects included within a single xCode project, go to editor>Validate project settings. This will set the compiler to LLVM 5.0 even if you don't see that option normally

如果单个 xCode 项目中包含多个项目,请转到editor>Validate project settings。即使您通常看不到该选项,这也会将编译器设置为 LLVM 5.0

回答by Jignesh Rajodiya

Go to BuildSettings->BuildOptions->CompilerFor c/c++/Objective C and change that to LLVM GCC 4.2 from 'Unsupported Compiler GCC4.2'

转到 BuildSettings->BuildOptions->CompilerFor c/c++/Objective C 并将其从“不支持的编译器 GCC4.2”更改为 LLVM GCC 4.2