 This video will teach you how to compile your first C++ program using your Mac. In order to complete this tutorial, we will need to install a C++ compiler. Mac OS is compatible with the free GNU compiler collection, also known as GCC. GCC is completely free to download and install. You can get GCC on your Mac, simply by installing something called command line tools for Xcode. First, open up a terminal window. Then enter the following installation command. The C++ compiler within GCC is called G++, and this is what we will use to compile our code. We can check that G++ is correctly installed by checking the version. Enter the G++ command followed by the version flag. If GCC has been installed correctly, you will see the compiler version displayed. Now that we have the compiler, we need to create a file containing some C++ code. Enter the nano command followed by the file name hello world dot cpp. When the nano file editor opens, enter the hello world sample code. To save the code and exit nano, press the control key and X. You will be prompted to save the file. Press Y, and then press the enter key. A file will now have been created containing our C++ code. Next, we need to compile this code using G++. Enter the G++ command followed by the O flag to specify the output file name. We will call the output file hello world. Then specify the source code file that we have just created. Entering this command will run the compiler, creating an executable file called hello world. Now we can test our first C++ program by running it from the terminal. Congratulations! You have compiled and executed your first C++ program. Check out the full article to learn how to build and run this code using the Xcode IDE. Visit sitech.com forward slash cpp mac.