tags:

views:

721

answers:

6

I have a text book already and need a painless!! way to write and test the code

A: 

XCode or GCC will nicely for you I think.

Jim Blizard
+6  A: 

Your OSX DVD will have a "SDK", or Software Development Kit. Install that, and it will provide XCode and GCC, which are tools to compile with.

Paul Nathan
+1also adding that you can DL xcode online.
acidzombie24
…at connect.apple.com. You need to sign up for a free account to download Xcode, but it will probably be a newer version than on your system install disc.
Chuck
+2  A: 

You can create "Command Line Utility" apps in C++ using XCode (Project -> New)

crashmstr
+1  A: 

If you install Xcode from the DVD supplied with your mac Gcc and friends will wind up in your path. You can use them from the command-line just as you would on any other (Unix-y) OS that supports Gcc.

Vim is pre-installed on the Mac and with a bit of tweaking in ~/.vimrc you can edit C++ code there.

You're not tied to using Xcode if you find it painful.

Adam Hawes
+3  A: 

Since this guy is just starting out...

Bok, you want to run "g++", or /usr/bin/g++, on your program source file in a terminal window. (Things will go easier if your source file ends in .cc, .cxx, or .cpp.)

E.g.:     g++ foo.cc -o foo -Wall

g++ is installed when you install the OSX SDK from the disks that came with your computer... (Apple's Software Development Kit is not installed by default. But it is included, for free, with every Apple computer sold.)

Mr.Ree
A: 

If, for some reason, you don't want to use Xcode, you could install fink , then do a

fink install g++ make

which will give you the basics of a unix command line build environment (like most tutorials assume you have). I think you need to install the stuff from the developers DVD too, so you should really consider just using Xcode.

You might also want to

fink install emacs22-carbon

but that depends on your choice of editor. You probably need to install a few libraries and such as you go along.

dmckee