C Compiler

Discussion in 'Mac Programming' started by Techguy172, Aug 28, 2008.

  1. macrumors 68000

    Joined:
    Feb 2, 2007
    Location:
    Ontario Canada
    #1
    I need a C Compiler to use while I learn C, Xcode doesn't work because I cannot compile. Or is there something I need to change?

    Preferably Free.

    Thanks
     
  2. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    Xcode comes with the GCC C compiler. It includes everything you need. If you are having problems you'll need to provide some more information.
     
  3. thread starter macrumors 68000

    Joined:
    Feb 2, 2007
    Location:
    Ontario Canada
    #3
    Yes I know it can Compile C but only if you are doing the whole thing, Interface and all. like say if i just want to write simple programs with text and simple commands. I don't want an interface, just output. I don't know any way of XCode doing this.
     
  4. macrumors regular

    Joined:
    Mar 5, 2006
    #4
    Create a Standard Tool project in Xcode. Doing so will create a command-line program for you. If you're using Xcode 3, you'll have to choose Run > Console to open Xcode's debugger console and see the output from your program.

    You can also run GCC from the command line if you don't want to use Xcode. Launch the Terminal application and navigate to the directory where your source code files are.
     
  5. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #5
    Not true. You can either compile on the command line or create a command line based application using the templates provided.

    Edit : The post above gives good information on how to do that specifically.
     
  6. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    Install the Developer Tools as suggested an use gcc, again as suggested. Gcc is a command-line C compiler: you don't need to use XCode at all
     
  7. thread starter macrumors 68000

    Joined:
    Feb 2, 2007
    Location:
    Ontario Canada
    #7
    Thank You, It works exactly the way I wanted.
     

Share This Page