Configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs that run on Windows
- Install Visual Studio Code
- Install the
C/C++ extensionfor VS Code. You can install the C/C++ extension by searching for 'c++' in the Extensions view(Ctrl+Shift+X)
- Extract
msys64.zipto diskC:\
- Add the path of Mingw-w64 bin folder to the
Windows PATH environmentvariable by using the following steps:
- In the Windows
search bar, type 'settings' to open your Windows Settings- Search for Edit environment variables for your account
- Choose the
Path variablein yourUser variablesand then selectEdit.- Select
Newand add theMingw-w64destination folder path to the system path. The exact path depends on which version of Mingw-w64 you have installed and where you installed it. If you used the settings above to install Mingw-w64, then add this to the path:C:\msys64\mingw64\bin.- Select
OKto save the updated PATH
To check that your Mingw-w64 tools are correctly installed and available, open a new Command Prompt and type:
gcc --version
g++ --version
gdb --version


