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.
Are there any settings in Xcode that say whether the compiler should be able to do objective-C, anything like that?
Thanks! Bob
|