Setup on Linux
g++ via your package manager · ~5–10 minutes · part of Compiler Setup
1. Install the toolchain
Open a terminal and use your distribution’s command:
Debian / Ubuntu / Mint / WSL (Ubuntu):
sudo apt update
sudo apt install -y build-essential gdb
Fedora / RHEL / CentOS:
sudo dnf install -y gcc-c++ make gdb
Arch / Manjaro:
sudo pacman -S --needed base-devel gdb
openSUSE:
sudo zypper install -y gcc-c++ make gdb
(The course only requires the compiler; gdb is optional and used by the
debugging walkthrough later.)
2. Verify
g++ --version
Any g++ ≥ 9 works for this course; 13+ is comfortable. Most distributions from the last few years already qualify.
3. First compile
mkdir -p ~/code/cpp-course/unit-01 && cd ~/code/cpp-course/unit-01
nano hello.cpp # paste the sanity-check program, save with Ctrl+O, exit Ctrl+X
g++ -std=c++17 -Wall -Wextra hello.cpp -o hello
./hello
You should see the program’s output. Errors? See FAQ troubleshooting.
4. Editor (recommended, 5 min)
Install Visual Studio Code (or use your favourite editor), add the C/C++ extension, and follow toolchain/vs-code-tips.md for a one-keystroke build and a working debugger.
On Windows but using WSL? Everything above works inside WSL Ubuntu. Compile and run inside the WSL terminal; the VS Code Remote-WSL setup keeps editing comfortable.
Next: verify with the course’s sanity check → then Lesson 1.