1.5: Download and Install App for C++ Programming (Mac Users)

Introduction to Programming with C++ · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC-SA 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    1.5: Download and Install App for C++ Programming (Mac Users)

    Go to App Store and search for "Xcode" . Download the app: (It may take about 11 GB of your computer memory spaces and it will take a while to download and install)

    Xcode.png

    If have successfully installed Xcode on your Mac computer, congratulations!


    Get Started with Xcode

    Step 1: Upon the completion of downloading and installing, launch the app (You may click on "Open" as shown below or go to the Launchpad on your computer to find the app and launch it from there)

    Open.png

    After the app was launched, you will see following window opened:

    Launch.png

    Step 2: Click on "Create a new Xcode project" as highlighted above. Then following window opens:

    SetupProject.png

    Step 3: Make sure "macOS" and "Command Line" are selected, and then click on "Next". Following window opens:

    Setup.png

    Step 4: Name your project. Here I name my project as myProject. Then click on "Next". We will see following screen:

    location.png

    Step 5: I create a folder "CSCI 40" on the desktop and navigate to this folder as pointed. It means, the project and associated files will be saved into this folder. Then click on "Create". Now, a project is created and project window will be opened as following:

    main.png

    Click on "main.cpp", we will see following screen:

    preload-1.png

    The source file "main.cpp" opens in the middle panel with preloaded code.

    Step 6: Modify the preloaded code as following:

    close panel.png

    You may close the right panel to expand the view of the source file by clicking the icon on the up right corner as pointed above.

    Now, the project window looks like below:

    large space.png

    You may close the right panel to expand the view of the source file by clicking the icon on the up left corner.

    Now, let's compile and run the program.

    Step 7: To compile and run the program, click on the triangle as pointed below: (click on OK on the popup window)

    Run.png

    After the program is being executed, a new panel shows up at the bottom of the project window. The output of the program is displayed inside of this panel. For this sample program we are running, the output of the program is a message: Good Morning! We refer this panel as Output Window.

    complete.png

    To write another program, you may create a new project by following the steps shown above, or keep this project open and modify the code.

    Congratulations! You have successfully written and execute a C++ program with Xcode on a Mac machine.


    This page titled 1.5: Download and Install App for C++ Programming (Mac Users) was last modified on Wed, 24 Dec 2025 20:37:22 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Jin He.