im new to macs as i have recently got one and i just cant seem to find a C compiler for it whatever i download is usually a .tar.gz file which when i unarchive i cant find the application. so can u guys help me ? and giv me the names of a couple of small sized free C compilers which i can download and the steps of how to finally get it to work?
THANX!!
Programming c or c++ on mac
March 19, 2007 - 8:32am
#1
Programming c or c++ on mac
Are you using OS X, and if so, have you installed the Developers tools that come with it? If so, you should have a whole bunch of compilers installed already (gcc, and/or g++).
http://developer.apple.com/tools/
can u help me in any other way ?
as i said all filew down load a .tar.gz and then i cant find the .app after unarchiving
When you download Xcode (the Apple supplied dev sftware, 900+MB) gcc is included. It downloads as a .DMG file.
Most likely, a compiler will be a program that you access from the Terminal, or through a developement environment (such as Apple's Xcode). So you want to open the Terminal (Applications/Utilities/Terminal.app), and untar the tarball by typing in the command tar xfzv $TARBALL_NAME_HERE in the directory that you have it stored in, and if you list the directorie's contents with ls -F, executable tools will show up in the resulting list with a '*' appended to the end, and you can run the tool by typing in ./$TOOLS_NAME_HERE "./" makes sure that the terminal searches the current directory for programs to run, and not just the installed search paths for tools.
I'm hoping/assuming, since youu said you unarchived a tar.gz, and can't find the .app, that you have actually a bunch of files, but just didnt' recognize any of them as executable? If so, looking in the finder, the executable terminal tools look like little dark grey squares that are meant to look like little terminals, with "exec" printed in green on them, if you make the icon size huge to see it.
You're best bet is to just get the XCode environment, though, since it will have a .app, a nice, double clickable program, to get you started, and more often than not .tar.gz files are source code tarballs, that you have to build yourself, usually with the commands "./configure;make;sudo make install", which you'll need gcc installed for, that comes with Xcode developers tools.