Install a C Compiler in C

From the C cheat sheet ยท Setup ยท verified Jul 2026

Install a C Compiler

Install GCC or Clang, verify it, and compile a C source file.

bash
# Ubuntu or Debian
sudo apt update
sudo apt install build-essential
gcc --version
๐Ÿ“Œ build-essential includes GCC and common build tools on Debian systems
๐Ÿ’ก Xcode Command Line Tools provides Clang on macOS
๐Ÿ” Use cc when either GCC or Clang is acceptable
๐ŸŽฏ Compile with warnings enabled once the basic toolchain works
installcompilergccclang

Continue with C

Save the full cheat sheet or work through every related task.

Back to the full C cheat sheet