I have the following code:
@interface Building : GameObject
{
CGPoint mapSquarePos;
CGPoint SquareSize;
bool isBuilding;
UIImage *BuildingImage;
Person *garnisonedPerson; //Error is here
}
i have imported the Person.h file. What could cause this error
Try
and importing Person.h in your implementation file
If that doesn’t work, it seems BuildingImage could be a class name.
Update for Rickyman20
Tells the compiler that Person is a class. In general I do not import other header files within my header file. An example where I do this is when I use cocos2d.
In that case
#import "cocos2d.hin my header file allows the use of the whole cocos2d library within my header without causing a compiler error