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