Basic c++ class. Need free compiler

Discussion in 'Mac Programming' started by Yezman, Sep 12, 2011.

  1. Yezman macrumors newbie

    Joined:
    Jul 21, 2011
    #1
    So I am taking a c++ class and am in need of a compiler that is free. I looked up xcode 4, but it get that I have to have 10.7 (i have 10.6.7) from what I read (in the app store).

    Can anyone lead me to a free c++ compiler for 10.6.7, nothing special just a "basic" one will do.

    Thanks.
     
  2. dukebound85 macrumors P6

    dukebound85

    Joined:
    Jul 17, 2005
    Location:
    5045 feet above sea level
    #3
    get xcode 3.x.x or whatever. It's free on the apple site
     
  3. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #4
    Or just install it from the install DVDs that came with the Mac. I agree the latest version of Xcode 3 would be the better choice.
     
  4. EthanMiller macrumors member

    Joined:
    Aug 15, 2011
    #5
    Or just go to the terminal, cd to the directory, and type "g++ filename.cpp" without the quotes. The compiled file will be a.out in the working directory.

    If you need help with any of that, google is a good resource.

    cd is the change directory command. ~ represents your home directory, so if you wanted to go to the Dev folder in your Documents folder, you'd type "cd ~/Documents/Dev" and press enter (no quotes). If you ever want more, man opens the manual - "man cd" tells you about the cd command.

    Other useful ones are ls to list the contents of a directory, pwd to print the working directory (tell you where you are, basically), and open to open a file in it's default editor (Probably TextEdit for cpp files, but I do most of my editing in vi).

    Hope that's helpful!
     
  5. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    g++ isn't installed by default. It's only installed with Xcode (Dev Tools), or if you take some other action to obtain it elsewhere. Same goes for gcc and a lot of other developer tools.
     

Share This Page