Videos

If you don’t enjoy reading, here is a YouTube playlist of helpful installation videos.

     

Windows Installation

Important: Before proceeding with this document, make sure that you have run Windows Update within your Windows 10 or 11 environment. You must have the latest updates installed.

   

Step 1: Install VS Code

  1. Go to the VS code download page, and download for Windows.
    1. windows downloads page. black.
  2. Run the installer and accept all of the default settings.
  3. Click on Install and wait for Visual Studio Code to finish installing, then close the installer.

   

Step 2: Installing MinGW

This section is based on this guide from Microsoft

MinGW is a Windows C/C++ compiler tool set that will allow us to compile our C/C++ code into a .exe file.

  1. First install MinGW
  2. Open the installer and choose the Defaults for all settings.
  3. At the end of the installation run msys2 and then run the following command:
    1. MSYS2 Setup white
    2. (Shift + Insert is the paste shortcut in MSYS2’s terminal)
    3. pacman -S --needed base-devel
    4. mingw-w64-x86_64-toolchain
    5. image of a terminal
  4. Press enter when prompted to install all of the default packages, then press Y to confirm the install. This will take 1 to 5 minutes to finish. Once the install completes you can close msys2.
  5. Now we need to add msys2 to window’s PATH variable. Press the Windows key and begin typing “Edit environment variables for your account” until you see this option.
  6. image of a white web environment
  7. Now Select the “PATH” variable and click edit, in the window that opens click “New” and enter the following path for the default installation location of Msys2.
  8. C:\msys64\mingw64\bin
  9. image of multiple interactable boxes

   

Step 3: Adding VS code extensions

  1. After you Reboot open VScode and select the extensions tab. (5th from the top), and search for “C++”. We need to install the “C/C++” and “C/C++ Extension Pack” both from Microsoft.
  2. Far left bottom boxes plugin icon, shows C++ written into search bar
  3. Select the extension then click on install, these will provide Syntax Highlighting and other useful tools when working in C++
  4. C/C++ v1.12.4 microsoft 39M+ downloads, 498 reviews
  5. C/C++ Extension Pack v1.3.0 microsoft 11M+ downloads 24 reviews

   

Step 4: Check your work Hello World

Get the hello world program working. If you are reading this for recitation 1, you will need to follow directions from your TA to submit your work as proof that VSCode is working on your personal computer.

     

Mac Installation

   

Step 1: Installing VS Code

  1. Go to VS code download page , and download for Mac.
  2. windows icon, linux penguin icon, or apple icon
  3. After the download has finished, unzip the folder by double-clicking on it.
  4. finder window with an expanded dropdown
  5. Now you can see the “Visual Studio Code” application. Drag and drop this icon to the “Applications” folder of your computer.
  6. finder window
  7. Double click on the ”Visual Studio Code” icon to launch the application. (You might need to right click and select “open” if you cannot launch the program). Next, select the ”New Terminal” option to open the terminal window.
  8. VSCode black with Terminal option from top navigation expanded
  9. Install C/C++ extension. In the toolbar on the left hand side of the screen click on the bottom icon for Extensions. Search for C/C++ and click install.
  10. left navigation of plugins expanded with @recommended typed into the search bar

   

Step 2: Install g++

  1. Open a Terminal window.(One way is to press Command+Space, type Terminal in the search field, and press the Return key.)
  2. In the Terminal window type g++ and press the Return key. We will see an alert box like this:
  3. a white terminal overlaid with error box stating The `g++` commmand requires the command line developer tools.  install button is highlighted.
  4. Choose Install to get only the command line tools unless you want to learn Xcode.
    1. Xcode can be installed later from the App Store.
    2. After installation, type g++ in the Terminal, press the Return key, and verify the terminal prints the message, “no input files”.
    3. $ g++
      1. see expected error clang: error: no input files
    4. white terminal typed g++ and returned error

   

Step 3: Check your work Hello World

Get the hello world program working. If you are reading this for recitation 1, you will need to follow directions from your TA to submit your work as proof that VSCode is working on your personal computer.

   

Step 4: Install XCode

Please install XCode on your computer now. This is done via the App Store. The download take a while. Having this ready and up to date prevents issues down the road.