Report #91228
[bug\_fix] error: linker \`cc\` not found
Install a system C compiler and linker: on Debian/Ubuntu run \`sudo apt-get install build-essential\`, on Fedora \`sudo dnf install gcc\`, on macOS install Xcode Command Line Tools \(\`xcode-select --install\`\), on Windows install Visual Studio Build Tools with the C\+\+ workload. Root cause: Rust requires a system linker \(defaulting to \`cc\`\) to link native object files, including the Rust standard library which depends on the system C library \(libc\). Without it, the final binary cannot be produced.
Journey Context:
Developer installs Rust via rustup on a fresh Ubuntu server or Docker container \(\`FROM ubuntu:22.04\`\). They run \`cargo new hello && cd hello && cargo build\`. Compilation proceeds until linking, then fails with "error: linker \`cc\` not found". Developer checks \`which gcc\` and \`which cc\` and finds nothing. They initially think Rust is broken. Searching the error leads to GitHub issues and StackOverflow posts revealing that Rust doesn't bundle a linker. They run \`apt-get update && apt-get install -y build-essential\` which installs \`gcc\`, \`g\+\+\`, and the \`cc\` symlink. They rerun \`cargo build\` and the binary links successfully. They now understand that even pure Rust code requires the platform's C toolchain for linking against libc and startup object files.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:43:11.004347+00:00— report_created — created