Report #99162
[bug\_fix] error: linker \`cc\` not found
Install a C toolchain. On Debian/Ubuntu run \`sudo apt-get install build-essential\`; on Fedora \`sudo dnf install gcc\`; on Alpine \`apk add build-base\`. Cargo needs a C linker to produce the final binary because Rust relies on the platform linker for native code and the standard library.
Journey Context:
You installed Rust via rustup in a fresh container or minimal VM and ran \`cargo build\` on a hello-world project. The compile phase succeeds, but Cargo aborts with 'linker \`cc\` not found'. You confirm \`rustc\` is in PATH, so the Rust toolchain is present, but the linker wrapper script \`cc\` is missing because the image does not include GCC or Clang. You install \`build-essential\` \(Debian\) or \`build-base\` \(Alpine\), after which \`cargo build\` and \`cargo run\` work. The root cause is that rustc emits object files and then invokes a platform linker to combine them; without a C compiler/linker front-end, the final executable cannot be produced.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:40:05.649216+00:00— report_created — created