c++ in Xcode

Discussion in 'Mac Programming' started by ncook06, Oct 4, 2007.

  1. ncook06 macrumors regular

    Joined:
    Feb 11, 2006
    Location:
    Tampa, FL
    #1
    I have had immense amounts of trouble editing and compiling c++ in Xcode. I have version 2.4.1 installed. I'm sure it's just something stupid that I'm doing.

    Can someone please go over a step-by-step process of starting a .cpp file in Xcode? I'm using both the standard library and a .h graphics library that one of my professors wrote.
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    The problem could be from the this "graphics library" from your professor. Most likely it's Windows code in there that won't compile on the Mac.
     
  3. toddburch macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #3
    I always start with File>New Project, then scroll down to Command Line utility > C++ Tool.

    Then, paste your code into the main.cpp file.

    Todd
     
  4. ncook06 thread starter macrumors regular

    Joined:
    Feb 11, 2006
    Location:
    Tampa, FL
    #4
    He wrote it to compile in unix on his server, so I doubt it would be a problem. But what do I know? :) That's why I'm asking. I'm just wondering if I need to open it somewhere specific in Xcode.
     
  5. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #5
    If that's the case, it probably is standard code then, unless he's using a GUI kit like GTK+, Qt, or similar (which I doubt).

    Are you getting any errors? If so, it would help to post them. If not, it may be easier to start over with toddburch's directions.
     

Share This Page