How to Install & Setup C++ on Windows, Mac, and Linux (2026)

Опубликовано: 21 Май 2026
на канале: SamoTechLab
22
1

💻 Zero-to-Code: The 5-Minute C++ Setup Guide
Stop troubleshooting and start coding. Follow this streamlined guide to turn your computer into a C++ powerhouse.

----------------------------------------------------------------------------------------------------------------------

🛠️ Phase 1: The Environment

Visual Studio Code (Industry Standard)
● Download: https://code.visualstudio.com/
● Action: Open VS Code --- Extensions (Ctrl+Shift+X) --- Search "C/C++ Extension Pack" by Microsoft ---- Install.

----------------------------------------------------------------------------------------------------------------------

⚙️ Phase 2: The Compiler (Select Your OS)

Windows (MSYS2)
1. Download: https://www.msys2.org/
2. Terminal Command:
cmd ~ pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain

macOS (Clang)
● Terminal Command: xcode-select --install

Linux (GCC)
● Terminal Command: sudo apt update && sudo apt install build-essential

----------------------------------------------------------------------------------------------------------------------

🚀 Phase 3: The First Test
1. Create a new file named hello.cpp.
2. Paste the code I wrote in the video
3. Build & Run (In VS Code Terminal):
● Build: g++ main.cpp -o myprogram
● Run: ./myprogram (Mac/Linux) or myprogram.exe (Windows)

❓ Troubleshooting
● "g++ is not recognized" (Windows): You must add C:\msys64\ucrt64\bin
to your System Environment Variables (Path).
● Missing Headers: Restart VS Code after the compiler installation to refresh the path.

If this helped you get started, don't forget to Like and Subscribe for more C++ tutorials!