• 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: Set Carbon or Cocoa Project to use C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set Carbon or Cocoa Project to use C++


  • Subject: Re: Set Carbon or Cocoa Project to use C++
  • From: Jamie Gjerde <email@hidden>
  • Date: Fri, 20 Jan 2006 13:54:25 -0800 (PST)

i am reposting this thread to the xcode users list to avoid any further confusion.
 
chris, are u trying to say that u can include a c++ header, where the c++ class is defined in a .cpp file, compiled as c++, in an objective-c++ file?? because u cannot do that ( u may not be saying that, i just want to clear this up though ). i've tried that and it does not work, unless i am really missing something here. both files would need to be compiled as objective c++ for that to work, regardless if u specify a build setting for the entire project or change the file type in the info window on the files.
 
jamie


Chris Hanson <email@hidden> wrote:
On Jan 20, 2006, at 11:44 AM, Jamie Gjerde wrote:
!
if u want to include a class in a .mm or a .m file that is defined in a .cpp file or vice versa, u will need to set the compile source as setting to Objective-C++ so it will just compile everything as Objective-C++. the compiler would in essence be treating all your files as if they had a .mm extension in this case.

As I said in my previous messages, you will not need to set the "Compile Source As" setting in this case.

otherwise if the comiple as source setting is set to according to file extension then a .cpp file will be compiled as C++ and a .mm file will be compiled as Objective-C++. the C++ compiler and the Objective-C++ file are not the same, or maybe i should say the files would not be compiled as the same language.

In general, you will want the ".cpp" file to be compiled as C+! + and the ".mm" file to be compiled as Objective-C++.  It's OK for the files not to be compiled as the same language — they aren't the same language, but they are designed to be compatible.

  -- Chris



Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!
 _______________________________________________
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

  • Prev by Date: Setting a ResourceManager file as not exectuable
  • Next by Date: Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
  • Previous by thread: Re: Setting a ResourceManager file as not exectuable
  • Next by thread: What changes to the project does it want to save?
  • Index(es):
    • Date
    • Thread