简体   繁体   English

llvm-gcc-4.2:错误

[英]llvm-gcc-4.2: error

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'.项目构建并在真实设备上运行良好,但 iphone 模拟器的构建在此错误“llvm-gcc-4.2:错误”中完成。 Any ideas?有任何想法吗?

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谢谢,费边

### 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 1 error.包含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).将 XCode 更新到 4.3.2 之后,因为它现在是一个应用程序(不再在 /Developer 中)。 Need to do these steps for both the simulator and the iOS device:需要对模拟器和 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

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.另外,查看 /Developer/Platforms/iPhoneSimulator.platform... 等,看看是否缺少目录或别名。 Also open your target Build Settings and verify the paths under Search Paths.同时打开您的目标构建设置并验证搜索路径下的路径。

Here's what my /Developer/Platforms/ looks like.这是我的 /Developer/Platforms/ 的样子。/开发者/平台/...

If you were like me you are upgrading a project.如果你像我一样,你正在升级一个项目。

Change your arch to arm7, which is now the standard I guess.将您的拱门更改为 arm7,我猜这是现在的标准。在此处输入图像描述

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。

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.对于 OSX Lion 和 XCODE 4.1,此错误似乎主要是主观的,要修复它只需安装 Kenneth Reitz、OSX-GCC-Installer package 并按照说明进行操作。 You'll be good to go.你会对 go 很好。 Following link, might help.以下链接,可能会有所帮助。 http://waqasshabbir.tumblr.com/post/19073648382/llvm-gcc-4-2-exe-error-on-mac-osx-lion-when-building http://waqasshabbir.tumblr.com/post/19073648382/llvm-gcc-4-2-exe-error-on-mac-osx-lion-when-building

You're using the wrong architectures setting in Xcode.您在 Xcode 中使用了错误的架构设置。 Please make sure that your app's target architectures is Optimized(armv7) or standard(armv6 armv7).请确保您的应用的目标架构是优化的 (armv7) 或标准的 (armv6 armv7)。

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

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