Xcode?

Discussion in 'Mac Programming' started by bravens52, Jan 21, 2010.

  1. bravens52 macrumors regular

    Joined:
    Jul 16, 2009
    #1
    Hey I'm taking a c++ class in colleg right Noe and I downloaded Xcode and I finished my assignment but Xcode won't let me build or compile my program. The options are there but aren't selectable? Does anybody know why? I have 10.6.2 if that helps.

    Also is there any other c++ programs besides Xcode for mac??
     
  2. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #2
    Xcode is not likely the problem.

    Did you create an Xcode project and add your source files into it so it can manage the build cycle? If so which project template did you choose as your starting point?
     
  3. bravens52 thread starter macrumors regular

    Joined:
    Jul 16, 2009
    #3
    No I just selected open new file because I use dev on windows in class and we don't have to hit new project. I'll try hitting new project
     
  4. bravens52 thread starter macrumors regular

    Joined:
    Jul 16, 2009
    #4
    im basically just trying to create a blank document..im not looking to make apps for iphone or mac ..just usage for class..im a little confused because i just bought this mac and i am use to quincy and dev and i have never used xcode before
     
  5. Sander macrumors 6502

    Joined:
    Apr 24, 2008
    #5
    Fox Xcode to compile your file, it needs to be part of a project. When you open Xcode, you can create a new project. "Command line" is probably a good choice.
     
  6. smirk macrumors 6502a

    smirk

    Joined:
    Jul 18, 2002
    Location:
    Orange County, CA
    #6
    Yeah, I think most IDEs require you to create a project before you start dumping code into it. So for you, I think you'd choose File->New Project, then select "Command Line Utility" on the left, and then "C++ Tool" on the right. Then replace the template code of main.cpp with your own.
     
  7. Makosuke macrumors 603

    Joined:
    Aug 15, 2001
    Location:
    The Cool Part of CA, USA
    #7
    Well, if it's a command line program, you can use gcc via the make command (it should be installed along with XCode), but past that I can't give you much help.
     
  8. bravens52 thread starter macrumors regular

    Joined:
    Jul 16, 2009
    #8
    i went ot the command tool under new project but it only shows main.c and not c++
     
  9. mags631 Guest

    Joined:
    Mar 6, 2007
    #9
    When you created the project, you should have clicked the "Type" dropdown and chosen "C++ stdc++". Good luck.
     
  10. smirk macrumors 6502a

    smirk

    Joined:
    Jul 18, 2002
    Location:
    Orange County, CA
    #10
    When you select the command line utility option from the left, it lets you choose from several different icons on the right. It sounds like you selected "Standard tool" when you should have selected "C++ Tool".

    Do you not have the "C++ Tool" option in your XCode?

    P.S. I only have the 10.5 version so maybe it's presented a little differently on yours.
     

Share This Page