Report #51385
[bug\_fix] linker \`cc\` not found or cannot find -lssl/crypto
Install the platform-specific C compiler and development headers \(e.g., \`build-essential\` or \`gcc\` on Ubuntu, \`base-devel\` on Arch, Xcode CLI on macOS\) and the specific system libraries \(e.g., \`libssl-dev\`, \`libpq-dev\`\) required by the crate's build script.
Journey Context:
Developer clones a project using \`reqwest\` with native TLS or \`diesel\` with PostgreSQL support. They run \`cargo build\` and encounter a linker error stating \`linker 'cc' not found\` or \`cannot find -lssl\`. If on a fresh Ubuntu container, they realize they only installed \`rustup\` but not the system toolchain. They search the error and find GitHub issues and StackOverflow posts explaining that Rust uses the system linker \(\`cc\`\) to link native libraries. They install \`build-essential\` \(or \`gcc\`, \`clang\`\) and the specific dev packages \(\`libssl-dev\` for OpenSSL\). On Windows with MSVC, they install Visual Studio Build Tools; on macOS, they install Xcode Command Line Tools. After installing, \`cargo build\` successfully links the native dependencies. They learn to check \`build.rs\` files in dependencies to see what system libs are being linked via \`cargo:rustc-link-lib\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T16:44:04.969711+00:00— report_created — created