• 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
Compiler pukes on Cocoa.h in .mm/.h file; __OBJ__ not defined
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiler pukes on Cocoa.h in .mm/.h file; __OBJ__ not defined


  • Subject: Compiler pukes on Cocoa.h in .mm/.h file; __OBJ__ not defined
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 27 Feb 2015 12:17:56 -0800

I’ve added a .mm Objective-C++ file to an old C++ project.  It has no code in it yet, except an empty Objecive-C @implementation.  Also, it #imports a counterpart .h file which in turn #imports <Cocoa/Cocoa.h>.

In Xcode 6.1, the compiler pukes on #import <Cocoa/Cocoa.h>, as though it does not know any Objective-C.  Testing the __OBJC__ macro, it is undefined.

The File Inspector indicates that my .mm file’s type is “Default - Objective-C++ Source” and the counterpart .h is  “Default - C Header”.  Looks OK to me.  Is there another Objective-C switch that needs to be flipped on somewhere?

Thank you,

Jerry
 _______________________________________________
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


  • Follow-Ups:
    • Re: Compiler pukes on Cocoa.h in .mm/.h file; __OBJ__ not defined
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Simulator losing network connection
  • Next by Date: Re: Compiler pukes on Cocoa.h in .mm/.h file; __OBJ__ not defined
  • Previous by thread: Re: Swift Question: Tuple Return Types
  • Next by thread: Re: Compiler pukes on Cocoa.h in .mm/.h file; __OBJ__ not defined
  • Index(es):
    • Date
    • Thread