Re: any way to have Xcode treat .cpp files like .mm files?
Re: any way to have Xcode treat .cpp files like .mm files?
- Subject: Re: any way to have Xcode treat .cpp files like .mm files?
- From: Alastair Houghton <email@hidden>
- Date: Wed, 28 Jan 2004 15:24:52 +0000
On 28 Jan 2004, at 13:30, Jens Miltner wrote:
> I'd like to put some Objective-C code into some preexisting C++ source
> files. Essentially, I'd like to implement a cross platform C++
> application based on Cocoa.
> I tried the Cocoa-Carbon-C++ sample code, but I couldn't get Xcode to
> interpret .cpp files as Objective-C/C++ files.
> I tried changing the filetype for a .cpp file to
> "sourcecode.cpp.objcpp", but that didn't change the way the compiler
> interprets the file. Looks like the compiler has hardwired to interpret
> .cpp as plain C++ and only interpret .mm as Objective-C++ ?
>
> Did I miss anything or is it plain impossible to compile .cpp files as
> Objective-C++?
Have you tried the -x compiler switch? You should be able to add -x
objective-c++ to the options for your .cpp files to get the behaviour
you want.
Take a look at the GCC manual, here:
http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/gcc/
Overall-Options.html#Overall Options
for more information.
Kind regards,
Alastair.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.