Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Set Carbon or Cocoa Project to use C++ (From: Jamie Gjerde <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.