Installing a Compiler
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 rocketThe shortcut
Three words: install, verify, pin.
Install
Run
sudo apt install g++. The package manager fetches GCC and the standard library.
The trap is thinking an editor is a compiler. Installing VS Code, or any editor, gives you somewhere to type. It does not give you anything that can turn C++ into a program. If a command says g++: command not found, the compiler is missing or not on your PATH.
Drills
Answer fast — trust the rule.
Which command checks that GCC is installed and reachable?
On a Mac after xcode-select --install, what does the g++ command actually run?
Which flag tells g++ to compile using the C++20 rules?
A Windows user wants Microsoft's own C++ compiler. What should they install?
Remember
- You don't install C++; you install a compiler that speaks it: GCC, Clang or MSVC.
- Shortcut: install, verify with
--version, pin the standard with-std=. - Trap: an editor is not a compiler.
