Setting Up a C++ Compiler
Install g++, clang or MSVC, configure your environment, and verify your first compilation.
Why You Need a Compiler
C++ is a compiled language. Source code is translated into machine code by a compiler before it runs. Three compilers dominate the ecosystem.
The Big Three: g++ clang MSVC
Pick a compiler based on your platform:
- g++ (GNU) — Linux default, available on macOS and Windows via MinGW
- clang++ (LLVM) — macOS default, fast diagnostics
- MSVC (Microsoft) — Windows native, ships with Visual Studio