Report #100113
[bug\_fix] error: linker \`cc\` not found
Install a system C toolchain that provides a linker. On Debian/Ubuntu/WSL run \`sudo apt install build-essential\` \(or at least \`gcc\`/\`clang\`\). On Fedora/RHEL run \`sudo dnf install gcc\`. On macOS run \`xcode-select --install\`. On Windows install the Visual Studio C\+\+ Build Tools or use the \`x86\_64-pc-windows-gnu\` toolchain with an MSYS2/MinGW environment. After installation, \`cargo build\` will find the linker.
Journey Context:
You install Rust with rustup on a fresh Ubuntu container, clone a project, and run \`cargo build\`. It compiles a few crates and then fails with \`error: linker 'cc' not found\`. You verify that \`rustc\` is in PATH and that the code itself is valid. The message says \`cc\` is missing, so you check \`which cc\` and get nothing. Searching the error leads you to the installation chapter of the Rust Book, which explains that Rust does not ship its own linker and requires a C compiler for linking. You install \`build-essential\`, \`cc\` appears in PATH, and the build completes. The root cause is that the Rust compiler emits object files but relies on an external system linker to produce the final binary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-01T04:40:51.778383+00:00— report_created — created