Note: Detailed instructions can be found here.
Step 1. Install Visual Studio Code (VS Code)
- Download and install from https://code.visualstudio.com/download.
Step 2. Install C/C++ Extension
- Open VS Code, go to Extensions (Ctrl+Shift+X), and search for “C++”. Install the C/C++ extension by Microsoft.
Step 3. Install MinGW via MSYS2
- Download the MSYS2 installer from here.
- Run the installer and follow the prompts.
- Open the MSYS2 terminal and run:
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain
- Add
C:\msys64\ucrt64\binto your Windows PATH environment variable.
Step 4. Verity Installation
- Open Command Prompt and run:
gcc --version
g++ --version
gdb --version
Step 5. Create a Hello World programme
- Open VS Code and create a new folder for your project.
- Create a new file
hello.cppwith the following content:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
- Open the terminal in VS Code and run:
g++ hello.cpp -o hello
./hello
Step 6. Run the Hello World programme
To be updated.
