xcode llvm-gcc-4.2:错误

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

llvm-gcc-4.2: error

iphonexcodeios4ios-simulatorxcodebuild

提问by fmo

The Project build & runs fine on a real device but a build for the iphone simulator finishes in this error 'llvm-gcc-4.2: error'. Any ideas?

项目构建并在真实设备上运行良好,但 iphone 模拟器的构建在此错误“llvm-gcc-4.2:错误”中完成。有任何想法吗?

llvm-gcc-4.2: error trying to exec '/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2': execvp: No such file or directory 
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 255

thx, Fabian

谢谢,法比安

采纳答案by Rayfleck

The first thing to do when things don't make sense is to clean the project (Product/Clean).

当事情没有意义时要做的第一件事是清理项目(产品/清理)。

Also, look in /Developer/Platforms/iPhoneSimulator.platform ... etc and see if there is a directory or alias missing. Also open your target Build Settings and verify the paths under Search Paths.

另外,查看 /Developer/Platforms/iPhoneSimulator.platform ... 等,看看是否缺少目录或别名。同时打开您的目标构建设置并验证搜索路径下的路径。

Here's what my /Developer/Platforms/ looks like. /Developer/Platforms/...

这是我的 /Developer/Platforms/ 的样子。 /开发人员/平台/...

回答by Adriano Lucas

### XCode < 4.3.2 ###

### XCode < 4.3.2 ###

After updating XCode from 4.2 to 4.3, I had exactly the same issue with lots of "unrelated" errors:

将 XCode 从 4.2 更新到 4.3 后,我遇到了完全相同的问题,其中包含许多“无关”错误:

make[1]: /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2: No such file or directory

Including a Command /Developer/usr/bin/clang failed with exit code 1error.

包括一个Command /Developer/usr/bin/clang failed with exit code 1错误。

I fixed that with:

我用以下方法解决了这个问题:

cd /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
ln -s llvm-gcc-4.2 gcc-4.2

### XCode >= 4.3.2 < 5.0 ###

### XCode >= 4.3.2 < 5.0 ###

After updating XCode to 4.3.2 and since it's now an App (not in /Developer anymore). Need to do these steps for both the simulator and the iOS device:

将 XCode 更新到 4.3.2 之后,因为它现在是一个应用程序(不再在 /Developer 中)。需要对模拟器和 iOS 设备执行以下步骤:

Fix the issue on the simulator:

修复模拟器上的问题

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
ln -s ../llvm-gcc-4.2/bin/llvm-gcc-4.2 gcc
ln -s ../llvm-gcc-4.2/bin/llvm-gcc-4.2 gcc-4.2

Fix the issue on iOS devices:

修复 iOS 设备上的问题

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
ln -s ../llvm-gcc-4.2/bin/llvm-gcc-4.2 gcc
ln -s ../llvm-gcc-4.2/bin/llvm-gcc-4.2 gcc-4.2

### XCode >= 5.0 ###(11/03/2014)

### XCode >= 5.0 ###(11/03/2014)

Fix the issue on the simulator:

修复模拟器上的问题

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
ln -s /usr/bin/llvm-gcc gcc-4.2

Fix the issue on iOS devices:

修复 iOS 设备上的问题

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
ln -s /usr/bin/llvm-gcc gcc-4.2

回答by James

If you were like me you are upgrading a project.

如果你像我一样,你正在升级一个项目。

Change your arch to arm7, which is now the standard I guess.enter image description here

把你的拱门改成 arm7,我猜这是现在的标准。在此处输入图片说明

回答by James

For the owner of this question, issue might have been resolved already but for people who're still stuck with this. This error is mostly seem subjective to OSX Lion and XCODE 4.1, to fix it simply install Kenneth Reitz, OSX-GCC-Installer package and follow the instructions. You'll be good to go. Following link, might help. http://waqasshabbir.tumblr.com/post/19073648382/llvm-gcc-4-2-exe-error-on-mac-osx-lion-when-building

对于这个问题的所有者来说,问题可能已经解决了,但对于仍然坚持这个问题的人来说。这个错误对于 OSX Lion 和 XCODE 4.1 来说似乎是主观的,要修复它,只需安装 Kenneth Reitz、OSX-GCC-Installer 包并按照说明进行操作。你会很高兴去的。以下链接,可能会有所帮助。 http://waqasshabir.tumblr.com/post/19073648382/llvm-gcc-4-2-exe-error-on-mac-osx-lion-when-building

回答by TommyV

You need to change the architecture to 'armv7' or 'armv6 armv7' and change the compiler for C/C++/Objective-C from LLVM GCC4.2 to Apple LLVM.

您需要将架构更改为“armv7”或“armv6 armv7”,并将 C/C++/Objective-C 的编译器从 LLVM GCC4.2 更改为 Apple LLVM。

回答by Xiaodong Jia

You're using the wrong architectures setting in Xcode. Please make sure that your app's target architectures is Optimized(armv7) or standard(armv6 armv7).

您在 Xcode 中使用了错误的架构设置。请确保您的应用程序的目标架构是优化(armv7)或标准(armv6 armv7)。