/* Setting up C++ */

In order to begin development in C++ you need to install a C++ compiler. There are a few different compilers you could install.

// Table of Contents

// Windows

Installing C++ on Windows is a bit more complicated than on other operating systems. In this guide we will be using the MinGW compiler. MinGW is a port of the GNU Compiler Collection (GCC) to Windows.

  1. Download the MinGW install from the MinGW website or from the direct link.
  2. In the installation wizard, choose a destination folder for MinGW. In most cases, the default location is recommended. Once it's completed make sure you check the Run MYS2 now box and select finish.
  3. A terminal window will open. In the terminal window, type the following command. This will install the MinGW-w64 toolchain.pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain
  4. Make sure you accept the default number of packages in the toolchain by pressing Enter.MinGW install
  5. Enter `Y` when prompted if you want to proceed with the installation.
  6. After installed you need to add your MinGW bin folder to your Window's PATH.
    1. Press the Windows key and search for Edit environment variables for your account.
    2. In the User variables section find and select the Path variable and click Edit.
    3. A popup will appear. Click New and paste the path to your MinGW bin folder. By default, it will be:C:\msys64\ucrt64\bin
    4. Click OK on all the windows to close them.
  7. Verify that MinGW is installed by opening a command prompt and typing:g++ --version gcc --version gdb --version

// Mac

Mac comes with the Clang compiler pre-installed. Clang is a C, C++, and Objective-C compiler that is part of the LLVM project.

  1. Open a terminal window and type the following command to check if Clang is installed.clang --version
  2. If Clang is not installed you can install it by typing the following command.xcode-select --install

// Linux

Linux comes with the GCC compiler pre-installed. GCC is a C, C++, and Fortran compiler that is part of the GNU project

  1. Open a terminal window and type the following command to check if GCC is installed.gcc -v
  2. If GCC is not installed you can install it by typing the following commands.sudo apt-get update sudo apt-get install build-essential gdb