Xcode project (GCC) is compiling my ObjC++ files as C

Discussion in 'Mac Programming' started by bronxbomber92, Mar 19, 2007.

  1. macrumors regular

    Nov 23, 2006
    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?


    Btw, I can upload the project if needed.
  2. macrumors 6502

    Jul 25, 2006
    Did you give the files with Objective-C++ the .mm extension?
  3. macrumors 6502a

    Sep 3, 2005
    Cramlington, UK

    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

Share This Page