1

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 files 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

kheraud
  • 5,048
  • 7
  • 46
  • 75

2 Answers2

1

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

fannheyward
  • 18,599
  • 12
  • 71
  • 109
0

move your import to like so

#ifdef __OBJC__
   #import <UIKit/UIKit.h>
   #import <Foundation/Foundation.h>
   #import <CoreData/CoreData.h>
   #import "GlobalVar.h"
#endif
J3RM
  • 1,702
  • 12
  • 17