Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Yezman

macrumors newbie
Original poster
Jul 21, 2011
2
0
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.
 
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.

get xcode 3.x.x or whatever. It's free on the apple site
 
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!
 
Or just go to the terminal, cd to the directory, and type "g++ filename.cpp" without the quotes.
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.