• 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: C++ in a Cocoa App - How Hard is THAT?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ in a Cocoa App - How Hard is THAT?


  • Subject: Re: C++ in a Cocoa App - How Hard is THAT?
  • From: Jim Ingham <email@hidden>
  • Date: Fri, 7 Oct 2005 17:39:59 -0700

The normal extension for ObjC++ files is ".mm". I am not sure what you mean by "It's the reference to it...". But anyway, you might try naming your file .mm. Xcode has to do two things when it's compiling an ObjC++ (as opposed to an ObjC) file, use the ObjC++ compiler to build the .o file, and use the g++ driver rather than the gcc driver so you link in all the C++ runtime goop. Maybe if you just put -ObjC+ + in the CFLAGS it's not doing the latter?

Jim

On Oct 7, 2005, at 4:35 PM, Lance Drake wrote:

Hi XCode folks,

In an effort to write a snazzy little app which accesses a C++ object that came from a CodeWarrior Carbon project, I wrote a little Cocoa app in which I would like to include that source file written in C++. Evidently, it's lots easier to include Cocoa in Carbon... but I digress.

As it happens, I cannot include the ".h" file in the Cocoa .m file (so as to be able to create the object and then refer to it) as the complaints appear immediately upon the compiler encountering the word 'class'.

Pouring thru the ADC refs, etc I found the instruction to set 'Other C Flags' to include '-ObjC++'. The file itself compiles. It's the reference to it that seemingly cannnot be added into the Cocoa world.

Before everyone heads out to the hills for the weekend - could somebody please send me a link to the effect, "hey, read this..." or somehow otherwise help me understand why this is not happening as I would wish?

Thanks VERY much!

Lance Drake

_______________________________________________
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


_______________________________________________ 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: 
 >C++ in a Cocoa App - How Hard is THAT? (From: Lance Drake <email@hidden>)

  • Prev by Date: Re[2]: C++ in a Cocoa App - How Hard is THAT?
  • Next by Date: Defining "Environment" build settings
  • Previous by thread: Re: C++ in a Cocoa App - How Hard is THAT?
  • Next by thread: Re: C++ in a Cocoa App - How Hard is THAT?
  • Index(es):
    • Date
    • Thread