iOS 5 Apple LLVM compiler 3.0 error

原创文章:转载请注明出处: http://www.cnblogs.com/mfryf/archive/2012/02/26/2369190.html 

从苹果的开发官网下载的程序编译不能通过总是报这个问题,

iOS 5 - Apple LLVM compiler 3.0 error

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 254

折腾了很久,终于解决了

网上有人说手动修改.pch 文件,添加所有引用的投文件到 .pch文件中

原始内容:

/*
#import <Availability.h>

#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

...
#endif
*/

修改后内容:

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif

二、试了之后,可以成功在模拟器上运行,但是真机调试还是有问题。

有经过一段时间探索,发现有些工程的编译器选的default compiler(Apple LLVM 3.0),

对了问题就在这里,不要用默认的,自己手动设置这个,然后编译就没问题了。

好像是因为选择默认编译器的时候,在编译的时候对于某些文件的编译会选错编译器。

目前这种方法能够成功解决我的问题环境 mac snow Leopard  xcode4.2 sdk ios5

三、还有一种情况,可能是项目的路径太复杂,或者有特殊符号,把项目移动到一个简单的路径下面,去掉特殊符号,

可以解决问题

希望对大家有帮助

原文地址:https://www.cnblogs.com/mfryf/p/2369190.html