Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setting Up C++ on Visual Studio Code

Configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs that run on Windows

Prerequisites

  • Install Visual Studio Code
  • Install the C/C++ extension for VS Code. You can install the C/C++ extension by searching for 'c++' in the Extensions view (Ctrl+Shift+X)

Extension

  • Extract msys64.zip to disk C:\

Path

  • Add the path of Mingw-w64 bin folder to the Windows PATH environment variable 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 variable in your User variables and then select Edit.
  • Select New and add the Mingw-w64 destination 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 OK to save the updated PATH

Check your MinGW installation

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

Example

Create Hello World Application

About

Configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs that run on Windows

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Contributors