Creating A Program in Xcode

  1. Go To: File > New > New Project (Command + Shift + N).
  2. Select “Command Line Tool,” then click Next.
  3. Enter the Product Name (Project Name).
  4. A directory will appear, select your desired location of this project, then click Create.

Adding Files

In the project navigator on the right, right click your project file and select new file.

Adding Header Files

  1. Select Header File and click Next
  2. A drop down with your desired directory appears.
  3. Name Your Header File
  4. Make Sure Targets is Checked (Warning occurs if left unchecked)

Adding C++ Files

  1. Select C++ File and click Next
  2. A drop down with your desired directory appears.
  3. Name Your C++ File
  4. Make Sure Targets is Unchecked

Adding C++ File to the Compile Sources

Unlike Visual Studios, in Xcode you must let the compiler know you're using the file.

  1. Click on the project in the navigator
  2. Select your project name under “Targets
  3. Click on the Compile Sources drop down
  4. Click the “+” button and in the drop down, select your C++ file, and click Add

You will receive this error, if you have forgotten to add your CPP file to the compile source.

And Now You're Ready To Start Coding! =)

Navigation

The best way to find something here is to use the search box in the upper right or the site index link below.

Print/export
Mobile QR Link