×

Advanced Coding & Software Engineering Program

Duration: 1 Year (12 Months)

Join our premium 1-year program to master cutting-edge technologies and become an industry-ready Software Engineer!

Course Coverage

  • Languages: C, C++, Java, JavaScript, Python
  • Web Technologies: HTML, CSS, Bootstrap 5, MERN Stack, Full Stack Development
  • Databases: MySQL, MongoDB
  • Data Science Libraries: Pandas, NumPy
  • Development Tools: Visual Studio Code, IntelliJ IDEA, PyCharm, Postman, Git, GitHub
  • Cloud Platforms: Vercel, MongoDB Atlas

Program Highlights

  • Live Classes: Interactive sessions with real-time doubt resolution
  • Hands-On Sessions: Practical coding exercises to build real-world skills
  • Industry Experts: Learn from professionals with years of experience
  • Live Project: Work on real-world projects to apply your skills
  • Get Certificate: Earn a professional certificate upon program completion

Course Fee: Only ₹1020 / month
Limited Period Offer!

Setting up the C++ Environment (Windows)



Last Updated on: 3rd Dec 2025 19:08:51 PM

C++ is a powerful and versatile programming language, but before you can start writing and running programs, it’s essential to set up your development environment correctly. Visual Studio Code (VS Code) is one of the most popular choices for C++ development due to its lightweight design, fast performance, and rich extension support.

 

While there are many tools available for writing C++ programs, in this tutorial we will focus on two widely used options:

  1. Dev-C++ – a simple and beginner-friendly IDE.

  2. Visual Studio Code (VS Code) – a modern, flexible code editor suitable for both beginners and advanced developers.

 

This overview will guide you through these environments so you can easily choose and configure the right setup for your C++ journey.

 

Prerequisites

  • A Windows PC (Windows 7 / 8 / 10 / 11).

  • Administrator access to install software.

  • Internet connection to download installers.

 

Dev-C++ (step-by-step)

 

Step 1 : Which Dev-C++? 

There are several builds (old Bloodshed, Orwell, Embarcadero). For most users choose Embarcadero Dev-C++ or a maintained fork that includes MinGW/GCC.

 

Step 2 : Download

  1. Open your browser and search "Embarcadero Dev-C++ download" (or the maintained fork).

  2. Or Click here to Download the installer (usually .exe).

 

Step 3 : Run the installer

  1. Double-click the downloaded .exe file.

  2. Accept User Account Control if prompted.

  3. Follow the setup wizard: Accept license, choose installation folder (default C:\Program Files\Dev-Cpp is fine).

  4. During the install, ensure the option to install MinGW/GCC is selected (if present). This installs g++, gcc, gdb.

 

Step 4 : First launch and verify compiler

  1. Open Dev-C++.

  2. Create a new file: File → New → Source File.

  3. Save it as hello.cpp.

  4. Paste the following code:

#include <iostream>
int main() {
std::cout << "Hello, world!\n";
return 0;
}

 

  1. Compile and run: Execute → Compile & Run (or press the play/compile icon).

  2. If compilation fails, open Tools → Compiler Options and ensure the compiler executable path points to the included MinGW bin folder (e.g., C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin).

 

Step 5 :  Verify inside Dev-C++ 

  1. Open Dev-C++

  2. Go to Tools → Compiler Options

  3. Click the Compiler set to configure 

  4. At the top it will show something like:

TDM-GCC 9.2.0 64-bit Release

This confirms Dev-C++ is using TDM-GCC 9.2.0.

 

Method 2 — Verify using Command Prompt

  1. Press Win + R, type cmd, hit Enter

  2. Type:

g++ --version

 You should see output similar to:

g++ (tdm64-1) 9.2.0
Built by MinGW-W64 project

 

If you get:

'g++' is not recognized...

Then Dev-C++'s GCC is not added to the PATH. In that case:

 

► How to use correct path:

Find the folder:

C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin

 

Then run:

"C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin" --version

 

This will show:

g++ (tdm64-1) 9.2.0

 

Method 3 — Compile a test program

  1. Create hello.cpp:

#include <iostream>
int main() {
    std::cout << "Compiler OK\n";
}

 

  1. In Dev-C++, click Compile & Run

 

If it compiles successfully without error, your TDM-GCC 9.2.0 is working correctly.

 

 

Step 6 :  Configure basic editor preferences (optional but recommended)

  • Tools → Editor Options to change font, tab size (set tab to 4 spaces), and enable line numbers.

  • Tools → Compiler Options to set language standard (if available) — choose C++11/C++14/C++17 depending on version.

 


 

Setting Up the C++ Environment in Visual Studio Code (VS Code) – Complete Tutorial

 

Step 1 :  Install Visual Studio Code

  1. Visit the official VS Code website

    https://code.visualstudio.com/

  2. Download Windows → User Installer (x64)

  3. Install with all default settings.

 

Step 2 : Install MinGW-w64 (C++ Compiler)

To compile C++ programs, you need a compiler like GCC/G++.

 

Step-by-step:

  1. Go to the official MinGW-w64 page
    https://winlibs.com/

  2. Download:
    "MinGW-w64 GCC x86_64 (latest stable version)"

  3. Extract the downloaded ZIP file.

  4. Copy the extracted folder to
    C:\mingw-w64

 

Step 3 :  Add MinGW Compiler to System PATH

So that g++ can run from any folder.

  1. Press Windows + R → type sysdm.cpl

  2. Go to the Advanced tab → Environment Variables

  3. In System Variables, select Path → click Edit

  4. Click New and add:

 

D:\Software\mingw64\bin

 

  1. Click OK to save.

 

Step 4 :  Verify Installation

Open Command Prompt and type:

g++ --version

 

If it shows version details → compiler is installed correctly.

 

 

Step 5 : Install Required VS Code Extensions

Open VS Code → go to Extensions (Ctrl+Shift+X)

Install these:

  1. C/C++ (by Microsoft)

  2. Code Runner (optional, for quick run)

  3. C/C++ Compile Run (optional)

 

Step 6 : Create Your First C++ Program in VS Code

  1. Create a folder
    Example: C:\CPP_Projects

  2. Open the folder in VS Code:

    • File → Open Folder

  3. Create a new file:
    hello.cpp

  4. Write:

#include <iostream>
using namespace std;

int main() {
    cout << "Welcome to C++ Programming!" << endl;
    return 0;
}

 

Step 7 : Run C++ Program (Two Methods)

 

Method 1: Run using Terminal (Recommended)

  1. Open VS Code terminal
    Ctrl + `

  2. Compile:

g++ hello.cpp -o hello.exe

 

  1.  Run:
hello.exe

 

Method 2: Run using Code Runner (Optional)

Click Run Code button on top.

 

Note: Code Runner may not support input (cin) correctly.

 

8. Configure Build & Run Tasks (Automatic Compile + Run)

To run C++ with a single key (Ctrl+Shift+B):

 

Create tasks.json

  1. Go to:

Terminal → Configure Default Build Task

 

  1. Select: C/C++ g++.exe build active file

 

This will generate a tasks.json file in .vscode folder.

 

Your C++ Environment in VS Code Is Ready!

Now you can write, compile, debug, and run C++ programs efficiently using VS Code.

 

Keep practicing — you're doing amazing!

Happy Coding!    yes

 


Online - Chat Now
Let’s Connect

Inquiry Sent!

Your message has been successfully sent. We'll get back to you soon!

iKeySkills Logo