开发者

Prefix.pch not included at compilation time

I have defined many constants in GlobalVar.h and other .h files. I import these files in the Prefix.pch file like this :

//
// Prefix header for all source fi开发者_运维问答les of the 'XXX' target in the 'XXX' project
//

#import "GlobalVar.h"
[...]

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif

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

But when I compile the project all the #defined identifiers are missing and reported as "Use of undeclared identifier XXX".

I searched in the Build settings and the PCH file is set as "Prefix Header"... I am on Base SDK 4.3 and XCode 4.0.2

Do you have hints to debug this ?

Thanks for your help


I came across this error yet, after cleaning DerivedData and restart Xcode I fix it. Hope to help.


move your import to like so

#ifdef __OBJC__
   #import <UIKit/UIKit.h>
   #import <Foundation/Foundation.h>
   #import <CoreData/CoreData.h>
   #import "GlobalVar.h"
#endif
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜