开发者

Prefix.pch not included at compilation time

开发者 https://www.devze.com 2023-04-09 08:11 出处:网络
I have defined many constants in GlobalVar.h and other .h files. I import these files in the Prefix.pch file like this :

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

精彩评论

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

关注公众号