Install Instructions in Xcode and Command Line for Mac OS X 10.5 Leopard.
Believe it or not the X series of Macintosh operating systems are built apon version UNIX. Also, OS X applications written in C++ or C are complied using a g++ complier (differences being there are some Apple only commands such as build for Intel or PowerPC and commands for the UNIX system). Below are the instructions I used to build the smallest recursive application on Macintosh OS X 10.5 Leopard.
Regular old text pad and command line:
Building using the command line is easy.
1. First create a plain text .cpp file using a text editor like Apple's supplied "Text Edit" or even better a programming notepad like "Text Wrangler".
2. Open the terminal either using spotlight and typing "Terminal" or by going to ~/Applications/Utilities/Terminal.app and running it from there.
3. In the Terminal navigate to the directory where you saved your file and compile and run like if you were on nickelback or timberlake.
Xcode:
Xcode is Apple's professional Application development application for Mac OS X. Building applications in Xcode is easy.
1. Open Xcode.
2. Go to File -> New Project
3. A pop up window will show up. Scroll down and find Command Line Utility and select C++ Tool. Click next.
4. It will ask to save where to save the project. Enter a Project Name and if you choose you can pick the folder that the project will be saved to. Click OK.
5. The main Xcode window will pop up and there will be 3 files created. One is "main.cpp", "TestProject" and "TestProject.1". main.cpp is where main is contained. You can rename it to whatever you want such as "Recursive.cpp" and it won't mess up your project. When you open the main.cpp file it contains this:
#include <iostream>
int main (int argc, char * const argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
return 0;
}
I personally have no clue what the parameters in main mean, but I learned that you can delete the main parameters and that does not affect the application itself.
6. When you are done typing your code, click the build icon at the top of the window and it will build the project. When it is done, in the editor code window it will show you your errors in error "bubbles" and you can then fix them. When you have no errors you can click Build and Go and this will Build your application and then Run it in the terminal window.
You can view the output there and then edit the code in the editor window and afterwards click "build and go" again to see your changes. You can also show the terminal window by clicking Run -> Console in the Toolbar Menu. This window will allow you to stop and debug your code or pause it while it is executing.
For Both:
After you are done make sure that your code compiles on Nickelback or Timberlake and then run it there so that there are no problems with your submission.Installation instructions for Ubuntu 7.10 - Gusty Gibbons on a clean
installation.