You are on page 1of 2

C for Vis al St dio Code Windo s

31 March 2021 23:39

Originally reference page: https://code.visualstudio.com/docs/languages/cpp


C support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable C
development on Windows

Install the extension


• Open VS Code.
• Select the Extensions view icon (4 squares) on the Activity bar .
• Search for 'C'.
• Select Install.

Install GCC compiler using MinGW-x64


Install Mingw-w64 via the SourceForge website. You can use this Mingw-w64 link to download
the Windows Mingw-w64 installer.
1. Run the installer, which should be named ming - 64-install.e e in your
Download folder.
2. Check your system architecture – check if its 32 bit or 64 bit (most likely it will be 64
bit). For Architecture select x86_64 and then select Next.

3. On the Installation Folder page, use the default location for the Destination folder. Copy
the location as you will need it later.
4. Select Next to start the installation.

Add the MinGW compiler to your path


Add the path to your Mingw-w64 bin folder to the Windows PATH environment variable by
using the following steps:
1. In the Windows search bar, type 'settings' to open your Windows Settings.
2. Search for Edit environment variables for your account.
3. Choose the Path variable and then select Edit.
4. Select New and add the Mingw-w64 destination folder path,
with \ming 64\bin appended, 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:\Program
Files\ming - 64\ 86_64-8.1.0-posi -seh-rt_ 6-
re 0\ming 64\bin.
5. Select OK to save the updated PATH. You will need to reopen any console windows for the
new PATH location to be available.
6. Check your MinGW installation
Open a new Command Prompt or Terminal in Visual Studio Code and type:
gcc -- ersion
If you don't see the expected output gcc is not a recognized command, check your
installation (Windows Control Panel Programs Programs and Features) and make sure
your PATH entry matches the Mingw-w64 binary location where the compiler tools are
located.

You might also like