Report #47543
[bug\_fix] error: linker \`cc\` not found
Install a C compiler and linker toolchain. On Debian/Ubuntu, run \`sudo apt-get install build-essential\`. On Fedora, \`sudo dnf install gcc\`. On macOS, run \`xcode-select --install\`. Root cause: Rust compiles to native code and requires a system linker \(\`cc\`, \`gcc\`, or \`clang\`\) to perform the final linking step; minimal Docker images or fresh VMs often lack these.
Journey Context:
Developer sets up a new CI pipeline using a minimal Docker image like \`rust:1.75-slim\` or \`debian:bullseye-slim\` with rustup installed. They run \`cargo build\` and immediately hit the linker error. Initially believing Rust is broken, they search the error and find that the slim image lacks \`gcc\`. They update their Dockerfile to install \`build-essential\` or switch to the non-slim \`rust\` image, and the build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:16:46.457152+00:00— report_created — created