Using XCode for C (in CSC173)

Using XCode for C (in CSC173)

George Ferguson

Last update: Summer 2021

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
Image

This document was written for XCode 12.5.1 on macOS 11.5.1 Big Sur.

Create a new project from the XCode splash screen or by selecting New > Project... from the File menu

The project starts with an empty file named “main.c”. You may use this file or delete it and add others.

To change the compiler settings for the project (REQUIRED FOR CSC173):

By default, XCode builds an executable whose name is the same as the name of the project. That's fine if your project is named “project1” or something like that, but not so good if it's longer, has spaces, etc.

To rename the executable built for the project (optional but recommended):

To find the executable file built by XCode: