Report #8484
[bug\_fix] linking with \`cc\` failed: exit code: 1; note: /usr/bin/ld: cannot find -lssl
Install the system development packages for the missing library \(e.g., \`sudo apt-get install libssl-dev pkg-config\` on Debian/Ubuntu, \`brew install openssl\` on macOS with appropriate \`PKG\_CONFIG\_PATH\` export\). Root cause: Cargo's build scripts \(like \`openssl-sys\`\) use \`pkg-config\` to locate native C libraries; if the headers and static/dynamic libraries are not present in system paths, the linker fails to resolve symbols.
Journey Context:
Developer adds \`reqwest\` or \`rustls\` with native certs to \`Cargo.toml\` and runs \`cargo build\`. The compilation proceeds through many crates until the final linking stage, where it fails with a wall of text ending in "linking with \`cc\` failed" and "cannot find -lssl". Developer searches the error and finds GitHub issues on \`openssl-sys\`. They try \`apt-get install openssl\` but the error persists. They read the crate README more carefully and realize they need \`-dev\` packages \(headers and static libs\). After running \`apt-get install libssl-dev pkg-config\`, the build succeeds. On a CI/CD environment later, they forget this and hit the same error, cementing the lesson that native dependencies require system-level installation beyond just \`cargo add\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:39:51.986995+00:00— report_created — created