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

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

  1. macrumors regular

    Joined:
    Nov 23, 2006
    Messages:
    109
    #1
    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
    Code:
    -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.
     
  2. macrumors 6502

    Joined:
    Jul 25, 2006
    Messages:
    294
    #2
    Did you give the files with Objective-C++ the .mm extension?
     
  3. macrumors 6502a

    Joined:
    Sep 3, 2005
    Messages:
    686
    Location:
    Cramlington, UK
    #3
    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
     

Share This Page