在现有的iPhone项目上将编译器更改为llvm-clang [英] Changing Compiler to llvm-clang on existing iPhone Project

查看:136
本文介绍了在现有的iPhone项目上将编译器更改为llvm-clang的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在现有项目中将编译器版本切换到Clang llvm 1.0时,在预编译* .pch文件时遇到以下编译错误:

When I switch the Compiler Version to Clang llvm 1.0 in existing projects I get the following build error when Precompiling the *.pch file:

error: can't exec '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2' (No such file or directory)

有没有另一个设置,我需要更改以使我的项目使用新的编译器?

Is there another setting I need to change to get my project to work with the new compiler?

(我尝试清除所有目标)

(I did try a clean all targets)

更新:

要澄清:

由于新编译器确实能够处理新项目,不是我的系统缺少任何东西。

Since the new compiler does in fact work with new projects, the issue is not that my system is missing anything.

此外,Xcode不应该试图找到llvm-gcc-4.2,因为整个问题是,我从编译器切换到新的一个,Clang llvm 1.0。这是什么让我相信还有另一个设置要改变。

Additionally, Xcode should not even be trying to find llvm-gcc-4.2 as the whole point is that I switched from that compiler to the new one, Clang llvm 1.0. This is what has led me to believe there is still another setting to be changed.

感谢fbereto的建议。

Thanks to fbereto for his suggestion. The actual answer lies in the comments.

推荐答案

如果你查看错误指定的路径,你将找不到LLVM编译器 llvm-gcc-4.2 ):

If you look in path specified by the error you will not find an LLVM compiler (llvm-gcc-4.2) for the iPhone device:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/

这就是说存在于iPhone模拟器:

That being said one does exist for the iPhone Simulator:

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/

这一切都表示,虽然可以在模拟器的LLVM下编译你的iPhone应用程序,

All this to say that while it may be possible to compile your iPhone App under LLVM for the Simulator, no equivalent tool exists for the device itself.

(回答详见下面的注释。)

(Answer detailed in comments below.)

这篇关于在现有的iPhone项目上将编译器更改为llvm-clang的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆