Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. C++ Course

Lesson 12 of 45 · C++

Lesson 2: Setting Up Development Environment

Duration: 10 min

Setting Up Development Environment\n\nBefore you can write C++ code you need a compiler, a linker, and an editor or IDE. The most common toolchains are:\n- GCC (Linux & macOS) – sudo apt-get install build-essential or brew install gcc.\n- Clang – bundled with Xcode on macOS and also available via brew install llvm.\n- MSVC – comes with Visual Studio 2022 (Community edition works fine).\n- MinGW‑w64 – provides GCC for Windows.\n\nOnce a compiler is installed, you need an editor. VS Code is lightweight and works cross‑platform. Below is a minimal tasks.json that lets you build and run a single‑file program with g++:\njson\n{\n \"version\": \"2.0.0\",\n \"tasks\": [\n {\n \"label\": \"build and run\",\n \"type\": \"shell\",\n \"command\": \"g++\",\n \"args\": [\n \"-std=c++20\",\n \"${file}\",\n \"-o\",\n \"${fileDirname}/${fileBasenameNoExtension}\"\n ],\n \"group\": {\n \"kind\": \"build\",\n \"isDefault\": true\n },\n \"problemMatcher\": \"$gcc\",\n \"detail\": \"Compiled with g++\"\n }\n ]\n}\n\n\nIf you prefer a build system, CMake is the de‑facto standard. A tiny CMakeLists.txt looks like:\ncmake\ncmake_minimum_required(VERSION 3.15)\nproject(HelloCxx LANGUAGES CXX)\nadd_executable(hello main.cpp)\nset_target_properties(hello PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED YES)\n\n\n> Tip: Install the C/C++ extension from Microsoft in VS Code. It provides IntelliSense, debugging, and linting out of the box.\n\n---\n\n<Alert type="info">If you are on Windows and prefer a full‑featured IDE, Visual Studio Community offers a one‑click install for the MSVC toolchain and a powerful debugger.

Previous: Lesson 19: Constructors and DestructorsNext: Lesson 20: Copy Constructor, Assignment Operator, Rule of Three/Five