• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSObjCRuntime.h won't compile? Or .mm files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSObjCRuntime.h won't compile? Or .mm files? (From: Bob Sabiston <email@hidden>)
 >Re: NSObjCRuntime.h won't compile? Or .mm files? (From: Eric Albert <email@hidden>)
 >Re: NSObjCRuntime.h won't compile? Or .mm files? (From: Bob Sabiston <email@hidden>)

  • Prev by Date: Re: distributed builds in makefiles
  • Next by Date: Re: good xcode book?
  • Previous by thread: Re: NSObjCRuntime.h won't compile? Or .mm files?
  • Next by thread: Re: NSObjCRuntime.h won't compile? Or .mm files?
  • Index(es):
    • Date
    • Thread