0% found this document useful (0 votes)
14 views

InstallationGuide-for-C onVSCode

This document provides instructions for setting up a C++ development environment on Windows using Visual Studio Code and MinGW compiler. It details downloading and installing VS Code and MinGW, adding MinGW to the system PATH, installing the C/C++ extension in VS Code, creating a simple "Hello World" C++ program, and running and debugging it.

Uploaded by

ella1261996
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

InstallationGuide-for-C onVSCode

This document provides instructions for setting up a C++ development environment on Windows using Visual Studio Code and MinGW compiler. It details downloading and installing VS Code and MinGW, adding MinGW to the system PATH, installing the C/C++ extension in VS Code, creating a simple "Hello World" C++ program, and running and debugging it.

Uploaded by

ella1261996
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

1. Download and install Visual Studio Code from https://code.visualstudio.

com/

2. Install a compiler (MinGW-x64)

- Download MinGW from https://github.com/msys2/msys2-installer/releases/download/2022-06-


03/msys2-x86_64-20220603.exe
- Install the full Mingw-w64 toolchain (pacman -S --needed base-devel mingw-w64-x86_64-
toolchain)

- Add the path to your Mingw-w64 bin folder to the Windows Path environment variable.
- Check your MinGW installation
(g++ --version, gcc –version, gdb –vesion)

3. Install the extension for C/ C++

- Open VS Code
- Select the Extensions view icon on the Activity bar
- Search for 'C++'

- Select C/C++
- Click ‘Install’
4. Running a simple Hello World C++ program

- Click ‘Open Folder’


- Select the folder you created (eg: Workspace_C++)
- Click ‘Yes, I trust the authors’
- Click New File icon and give the name ‘helloworld.cpp’
- Write these lines

#include <iostream>
using namespace std;
int main()
{
cout << "Hello World";
return 0;
}

- Click ‘Run Build Task’ from Terminal menu (or) Run C/C++ file icon on the bar.
- Choose ‘C/C++, g++.exe build and debug active file’
- Click ‘Run C/C++ file’ icon on the bar
(or)
- From a new VS Code Integrated Terminal, you can now run your program by typing ".\
helloworld".

You might also like