Re: NSObjCRuntime.h won't compile? Or .mm files?
Re: NSObjCRuntime.h won't compile? Or .mm files?
- Subject: Re: NSObjCRuntime.h won't compile? Or .mm files?
- From: Eric Albert <email@hidden>
- Date: Thu, 22 Sep 2005 10:13:29 -0700
On Sep 22, 2005, at 8:07 AM, Bob Sabiston wrote:
On Sep 21, 2005, at 9:46 PM, Eric Albert wrote:
On Sep 21, 2005, at 3:16 PM, Bob Sabiston wrote:
Is there some trick to getting a .mm Objective C file to compile in Xcode?
Are you sure this is from an .mm file? This error occurs most frequently when you have a precompiled header that #imports <Cocoa/Cocoa.h> (or any other Obj-C header) but gets included for non-Objective-C code. To fix that, protect your #import of Cocoa/Cocoa.h like this:
#if __OBJC__
#import <Cocoa/Cocoa.h>
#endif
Hope this helps,
Eric
Yes, it is very weird. The file is called CoreImage.mm, and I get those errors even if I comment out every single thing but the
#import <Cocoa/Cocoa.h> !
However, this IS a carbon project, and this is my only .mm file. It is basically adapted from some sample code about using Core Image functions in a carbon app. However, like I said, I can still comment out everything and get that error.
Did you try the #if from above? If so, what happened? And as Chris says, a build log would be helpful.
-Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden