Report #12328
[bug\_fix] linker \`cc\` not found or undefined reference to \`symbol\_name\`
The root cause is a missing system toolchain \(C linker like gcc, clang, or MSVC\) required by rustc to link the final binary, or missing native C library dependencies \(e.g., OpenSSL, SQLite\) that a \`\*-sys\` crate wraps. The fix is to install the system build tools: on Debian/Ubuntu \`sudo apt-get install build-essential pkg-config\`, on macOS \`xcode-select --install\`, on Windows install Visual Studio Build Tools with C\+\+ workload. For undefined reference errors, ensure the development libraries are installed \(e.g., \`libssl-dev\`, \`libsqlite3-dev\`\) so that \`pkg-config\` or the crate's \`build.rs\` can locate the headers and libraries.
Journey Context:
You spin up a new Docker container or GitHub Actions runner and clone a Rust project. You run \`cargo build\` and immediately get 'error: linker \`cc\` not found'. You realize Rust requires a C linker to produce the final executable. You install \`build-essential\`. Later, the build fails with 'undefined reference to \`SSL\_CTX\_new\`' when compiling the \`openssl-sys\` crate. You search and find that \`-sys\` crates expect the system library to be present. You install \`libssl-dev\` \(or \`openssl-devel\` on RHEL\) and the build succeeds because \`pkg-config\` now finds the library.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:43:56.605823+00:00— report_created — created