Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expected specifier-qualifier-list before 'CGPoint'

My project compiles and runs fine unless I try to compile my Unit Test Bundle it bombs out on the following with an "Expected specifier-qualifier-list before 'CGPoint'" error on line 5:

#import <Foundation/Foundation.h>
#import "Force.h"

@interface WorldObject : NSObject {
    CGPoint coordinates;
    float altitude;
    NSMutableDictionary *forces;
}

@property (nonatomic) CGPoint coordinates;
@property (nonatomic) float altitude;
@property (nonatomic,retain) NSMutableDictionary *forces;

- (void)setObject:(id)anObject inForcesForKey:(id)aKey;
- (void)removeObjectFromForcesForKey:(id)aKey;
- (id)objectFromForcesForKey:(id)aKey;
- (void)applyForces;

@end

I have made sure that my Unit Test Bundle is a target of my WorldObject.m and it's header is imported in my testing header:

#define USE_APPLICATION_UNIT_TEST 1

#import <SenTestingKit/SenTestingKit.h>
#import <UIKit/UIKit.h>
#import "Force.h"
#import "WorldObject.h"


@interface LogicTests : SenTestCase {
    Force *myForce;
    WorldObject *myWorldObject;
}

@end
like image 256
Rob Avatar asked Dec 13 '25 07:12

Rob


1 Answers

You need to import <UIKit/UIKit.h> instead of <Foundation/Foundation.h> in your header file (the top file in your question).

like image 177
shosti Avatar answered Dec 15 '25 15:12

shosti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!