Setup VS Code with C++ On Windows

KNuggies
6 min readApr 5, 2023

In this short article, we’ll be installing VS Code and MSYS2 to compile, run, and debug C++ programs on Windows 11. These same steps work for Windows 10 as well.

This article has a companion video on YouTube. Follow along here:

Install VS Code

If you do not already have VS Code installed, it can be downloaded and installed from here. Simply download and run the installer with the default options.

Install MSYS2

Next, we want to download and install MSYS2. Be sure to download the latest version of MSYS2 from msys2.org. Again, just download and run the installer with default options.

By default MSYS2 is installed to “C:\msys64”. If you changed the installation directory, be sure to note the location so you can adjust the path variables as need.

Once the installation is complete, it will open the MSYS2 terminal automatically. If it doesn’t open, you can go to the start menu and search for MSYS2 to run it from there.

Install GCC

From the MSYS2 terminal, run the following command to install the gcc compiler:

--

--

KNuggies

Creating education content for programming in C++, Python, and other languages.