Installation #
- Install the
C/C++ extension for VS Code
extension in Visual Studio Code - Download the latest MSYS2 installer
- Open a MSYS2 terminal window and install the MinGW-w64 toolchain
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain
Accept the default number of packages in the
toolchain
group by pressingEnter
. - Add the path of your MinGW-w64 bin folder to the Windows PATH environment
If you used the default settings above, then this will be the path:
C:\msys64\ucrt64\bin
. - Check your MinGW installation
gcc --version g++ --version gdb --version
- Configure VS Code for C++ development
Add the configuration files to the .vscode folder at your project’s root.