Report #4881
[bug\_fix] linker \`cc\` not found
Install the system C compiler toolchain: on Debian/Ubuntu run \`sudo apt install build-essential\`, on macOS run \`xcode-select --install\`, on Windows install Visual Studio Build Tools with C\+\+ workload, or configure an alternative linker in \`.cargo/config.toml\`.
Journey Context:
The developer installs Rust via rustup on a fresh Ubuntu WSL instance or Docker container. They run \`cargo new hello\` and then \`cargo build\`. Instead of compiling, they get an error that the linker \`cc\` was not found or that linking with \`cc\` failed. They search online and realize that rustup installs the Rust toolchain but not a system linker or C compiler. They check if gcc is installed with \`which gcc\` and find nothing. Following the Rust installation guide, they install build-essential on Linux or the Xcode CLI tools on macOS. On Windows with the MSVC toolchain, they realize they need to install Visual Studio with the C\+\+ build tools. After installing the system compiler, \`cargo build\` successfully links the binary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:13:45.633085+00:00— report_created — created