Xcode: not compiling

Discussion in 'Mac Programming' started by winterquilt, Dec 10, 2011.

  1. winterquilt macrumors regular


    Feb 18, 2008
    I wanted to program some shell scrips for the Windows environment in C or C++, not sure how to do that, but I have a few beginner examples. Anyway, I used a Mac (of course) and was told I could do this and compile them in Xcode, but I find, even having just downloaded v3.2.6 from Apple (I am using Snow Leopard) that the Compile menu s completely greyed out.

    I read online that it could well be the GCC compiler I am missing but I don't get any of that, plus, I've just installed the Xcode developer tools fresh and I still have the problem.

    Here is the code I am trying out:

    #include <iostream>
    using namespace std;
    int main()
      cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
      return 1;
    Should be simple right, well, I can't compile it so I don't know if it'll work.

    I said I wanted to code for Windows and execute shell commands I know, but was led to believe I could do this all on a Mac, which I think would be nicer.

    Am I barking up the wrong tree?

    Thanks in advance.

    (I have done a search of this forum and been all over the internet, but still cannot find a sollution)
  2. jiminaus macrumors 65816


    Dec 16, 2010
    Did you create a project, or did you just create a new file? XCode needs a project in order to be able to compile.

    This blog post might help you get started.
  3. winterquilt thread starter macrumors regular


    Feb 18, 2008

Share This Page