C++ Compiling In Xcode

Discussion in 'Mac Programming' started by Wolfgang, Nov 6, 2006.

  1. Wolfgang macrumors member

    Jun 12, 2006
    I am new to programming and am taking a class in c++. Is there a way to simply create a single c++ file with xcode? how do you compile it? i tried the xcode help and that didnt really help too much. any help would be much appreciated. thank you
  2. Catfish_Man macrumors 68030


    Sep 13, 2001
    Portland, OR
    Xcode is oriented around projects, not files, which is why I use a text editor + gcc for small stuff.
  3. szymczyk macrumors regular

    Mar 5, 2006
    Create a C++ Tool project. Choose Build > Build or click the Build button in the project window toolbar to build the project.
  4. LtRammstein macrumors 6502a


    Jun 20, 2006
    Denver, CO
    I use the same thing Wolfgang. As a warning, since I do this to all my C++ projects, the compiler XCode uses for C++ GNU is not as good as using Visual Studios 2005. So when you see an error and it marks it, you will have to decypher the error message to the best of your ability. It gets frustrating at times. Also, when you add a .cpp file to the project, it will AUTOMATICALLY create a Header file (.h). I don't know what level of C++ coding you're in, but some projects you might do you can just delete the .h file since it is a small project. Also, if I remember correctly back when I first started C++ coding, you will do some projects with the GUI files in Visual Studios 2005. XCode uses something different. I will have to consult my friend on what he used, because at the time I had my ol' iBook.

    Anyways, that should help if you get stuck on anything.

Share This Page