PDA

View Full Version : Xcode project (GCC) is compiling my ObjC++ files as C




bronxbomber92
Mar 19, 2007, 02:33 PM
Hey, I'm trying to compile a project that contains ObjC++ and C++ files. The problem is that GCC is compiling the files as C/ObjC. The build log had this flag
-x objective-c
I know that is the problem, but I don't know how to change it (or where). I've looked in the project build settings and the target build settings, but I don't see that flag anywhere... Does anyone have any suggestions to fix this?

Thanks,
Jedd

Btw, I can upload the project if needed.



kpua
Mar 19, 2007, 03:14 PM
Did you give the files with Objective-C++ the .mm extension?

lazydog
Mar 19, 2007, 03:49 PM
Hi

You can use .cpp as well.

Under Project/Project Settings there is a Build Tab. In there there should be an option for 'Compile Source As'. On my system it's set as 'According to File Type', but I guess you could force it to C++.

Also under preferences File Types the file types for source code are under text/sourcecode… but I'm not sure what to do with them. I doubt that they would need 'fixing' anyway.

b e n