English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

OK, so i wanted to write C++ on OSX. Someone told me to install Xcode, so I did. I opened it up, opened up a new C++ file, and typed a simple program from a tutorial. However, I can't compile it! The menu option for compile is grayed out (in fact all of the build tools are). Why can't I compile it?

Sorry, I have never programmed before (i have only done web design and XML; and a one-week crash course in computer class on C programming). In computer class we had a program (Borlan C or something) where we typed in our code, pressed compile, and ran the programs. That is the extent of my knowledge. Why won't Xcode let me do that, and how do I get it to let me?!?

Thanks.

2007-01-22 10:04:06 · 3 answers · asked by milan 4 in Computers & Internet Programming & Design

OSX Tiger come with gcc compiler (thats what i read).

I downloaded the Xcode 900mb file. On the developer website, it just lists Xcode, it doesn't have a download for Xcode tools.

2007-01-22 10:33:50 · update #1

OSX Tiger come with gcc compiler (thats what i read).

I downloaded the Xcode 900mb file. On the developer website, it just lists Xcode, it doesn't have a download for Xcode tools.

http://developer.apple.com/tools/download/
Just Xcode. No Xcode tools.

2007-01-22 10:35:16 · update #2

3 answers

you get it from the second disk in an os x package or it's on the BIG dvd as an extra install!

if you don't mind downloading extra stuff, you can get your c compiler here
http://www.apple.com/downloads/macosx/development_tools/crosscompilerforwin32.html

2007-01-22 10:35:49 · answer #1 · answered by jake cigar™ is retired 7 · 0 0

"However, I can't compile it! The menu option for compile is grayed out (in fact all of the build tools are). Why can't I compile it?"
Probably because you didn't install the build tools. Xcode is just an IDE. That is, a nice environment for you type code and have it compiled for you. The actual compilation is done by the compiler.

I don't use Macs, but IIRC you should have a CD or set of CDs from Apple with developer tools on them. Install whatever is relevant to C++. It should be Gcc, gdb, the C++ libraries, etc.

"n computer class we had a program (Borlan C or something) where we typed in our code, pressed compile, and ran the programs. "
Yeah, basically they taught you nothing about C++.

2007-01-22 18:14:02 · answer #2 · answered by csanon 6 · 0 1

I guess you didn't install a compiler like gcc for example. Xcode doesn't come with a prebuilt compiler so you must install it afterwards.
Gcc is included with Xcode Tools so installing this should fix it.
http://developer.apple.com/tools/xcode/

2007-01-22 18:10:11 · answer #3 · answered by agent-X 6 · 1 0

fedest.com, questions and answers