Shocking: No GCC installed?

A

AlexN

Guest
So I opened the terminal, and started writing a hello world program as usual.

When I compiled the file using "gcc -Wall -o hello hello.c",
it gave me "-bash: gcc: command not found".

No GCC installed? Or maybe the path is wrong? (Note: it's a fresh OS, I just got the iBook yesterday.)

PS: cc doesn't work either.
 
OP
D

d-funct

Guest
You need Xcode installed to have access to the GCC compiler ... its a free download but you have to do a free registration first :) just look for it on the apple website I think its under the developer bit ... maybe :)

BTW does anyone know of any tutorials for using the GCC program for C++? I've just started learning C++ and I have no idea how to compile it on my mac :S
 
OP
A

AlexN

Guest
d-funct said:
I've just started learning C++ and I have no idea how to compile it on my mac :S

Use g++ command instead of gcc. For example, g++ -Wall -o hello hello.cpp
 
Joined
Jun 25, 2004
Messages
1,779
Reaction score
65
Points
48
Location
Luxemburg, Europe
Your Mac's Specs
PowerMac G5 Dual 2GHz (June 2004), 2.5GB, Airport, black 5G iPod 30GB, white MacBook 2.0 2GB
d-funct said:
You need Xcode installed to have access to the GCC compiler ... its a free download but you have to do a free registration first :) just look for it on the apple website I think its under the developer bit ... maybe :)

No need for that. Xcode is delivered with every Mac, and every retail version of OS X.
On a standard factory installed Mac (like your brand new iBook, AlexN) you will find a folder called "Installers" in your Applications folder. In there is the installer for the Developper tools (means Xcode plus a bunch of utilities for developpers, including gcc).
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top