LLVM 2.0无法为iPhone模拟器构建。 GCC 4.2正常工作 [英] LLVM 2.0 can't build for iPhone simulator. GCC 4.2 works fine

查看:162
本文介绍了LLVM 2.0无法为iPhone模拟器构建。 GCC 4.2正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我建立我的项目(任何项目,真的 - 我试着创建一个新的空项目,结果相同),它使用Gcode 4.2在Xcode4或Xcode 3.2.4下编译。



如果我使用Xcode4下的LLVM 2.0或Xcode3下的LLVM 1.5构建,我会在编译时遇到编译时构建失败,但 模拟器。

我在LLVM下获得的构建错误全部在头文件中,我无法控制,比如UIView.h,UIDevice.h,UIApplication.h ,UIKit中的UITextView.h和UIWebView.h以及CoreGraphics中的CGPDFContext.h。



以下是WebView.h中的一个示例错误:

  @property(nonatomic)UIDataDetectorTypes dataDetectorTypes __OSX_AVAILABLE_STARTING(__ MAC_NA,__IPHONE_3_0); //< ---未知类型'UIDataDetectorTypes'

当UIDataDetectorTypes确实在UIDataDetectors.h中声明时包含在该文件中。



sniff 可能是Xcode 3.2.4或SDK配置中的一个错误。



尝试在Build Settings中放置一行,如下所示:Preprocessor Macros:

  -D__IPHONE_OS_VERSION_MIN_REQUIRED = 040100 

  -D__IPHONE_OS_VERSION_MIN_REQUIRED = 030103 


When I build my project (any project, really - I tried creating a new empty project with the same results), it builds fine with GCC 4.2 under either Xcode4 or Xcode 3.2.4.

If I build using LLVM 2.0 under Xcode4 or with LLVM 1.5 under Xcode3, I get compile-time build failures, but only when building for the Simulator.

The build errors that I get under LLVM are all in headers over which I have no control, such as UIView.h, UIDevice.h, UIApplication.h, UITextView.h and UIWebView.h in UIKit and CGPDFContext.h in CoreGraphics.

Here's an example error, in WebView.h:

@property(nonatomic) UIDataDetectorTypes dataDetectorTypes __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_3_0);   //<--- Unknown type 'UIDataDetectorTypes'

when UIDataDetectorTypes is indeed declared in UIDataDetectors.h which is included in that file.

sniff

解决方案

Might be a bug in Xcode 3.2.4 or the SDK configuration.

Try placing a line like one of these in your Build Settings Preprocessor Macros:

-D__IPHONE_OS_VERSION_MIN_REQUIRED=040100 

or

-D__IPHONE_OS_VERSION_MIN_REQUIRED=030103

这篇关于LLVM 2.0无法为iPhone模拟器构建。 GCC 4.2正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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