Installing a Compiler
Installing C++ means installing a compiler such as GCC, Clang or MSVC, checking it runs, and choosing which language standard it should use.
Check the compiler and selected standard before building a minimal program.
You want to build Rocket Run on your own laptop. There is no single "C++" program to download. What you install is a compiler, and there are three big families. Pick the right one for your system and a two-minute check tells you it works.
The rule
You don't install C++; you install a compiler that speaks it.
The three major compilers:
- GCC, run as
g++. The standard choice on Linux. - Clang, run as
clang++. The default on macOS, also common on Linux. - MSVC, Microsoft's compiler, installed with Visual Studio on Windows.
How to get one:
# Linux (Debian or Ubuntu)
sudo apt install g++
# macOS: installs Apple Clang and the command line tools
xcode-select --install
# Windows: install Visual Studio Community and tick
# the "Desktop development with C++" workload
# (or install MSYS2 if you prefer GCC)One surprise on macOS: typing g++ there runs Apple Clang under a familiar name. That is fine for learning.
Each compiler supports several language standards. Tell it which one you want:
g++ -std=c++20 rocket.cpp -o rocket