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: Jens Miltner <email@hidden>
- Date: Wed, 28 Jan 2004 16:36:30 +0100
Am 28.01.2004 um 16:24 schrieb Alastair Houghton:
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.
Yeah - of course, that did the trick. Thanks!
Any idea whether I can set the on a per-project basis for certain
filename patterns (e.g. *.cpp)?
</jum>
_______________________________________________
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.