This tutorial will demonstrate how to create and run your first C++ application in Mac OSX by using Xcode.
1. Launch Xcode.
2. Choose “Select a new Xcode project” from the Xcode window.
3. Select “Command tool” from the project template window as we are going to create a simple c++ command console program.
4. You will need to fill in some information about the project in the next wizard. I called this product name “HelloWorld”. Make sure that you enter the company identifier information. Lastly, make sure that you are choosing C++ in the project type.
5. You will need to specify where to keep you project. I create a sample folder for myself and called it cpp.
6. Click create to finish and launch the Xcode IDE now.
7. Click the main.cpp file on the left hand side.
8. You should be able to edit the file now in the Xcode editor. Add the following line of code after the “Hello, World”:
std::cout << "Running my first cpp program using Xcode!" << std::endl;
10. To build and run the program, press cmd+B or select Product->Run from the Xcode menu.
11. Your project should compile success now and notice that the output window should show the following result: