Nick
Nick

Reputation: 173

Error when compiling for device but not simulator

I get the following error when compiling my project for the device, but not the simulator: error: objc/objc-class.h: No such file or directory

One of the files i have imports objc/objc-class.h and this is where it chokes.

Base SDK is iPhone OS 4.0 and deployment target is OS 3.2

Thanks

Upvotes: 17

Views: 4614

Answers (4)

Doug
Doug

Reputation: 216

On iOS it's

#import <objc/runtime.h>

Upvotes: 11

Yan
Yan

Reputation: 886

Try

#import <objc/runtime.h>

instead of

#import <objc/objc-class.h>

This worked for me, both for simulator & device.

Upvotes: 48

hotpaw2
hotpaw2

Reputation: 70663

Do you have different include paths in your debug and release build settings?

If you don't want to play with the include paths, then adding the objc-class.h file to your project will also allow Xcode to find it.

Upvotes: 0

No one in particular
No one in particular

Reputation: 2672

Shouldn't that be:

#import <objc/objc.h> 

Upvotes: 1

Related Questions