Report #73419
[bug\_fix] ld: library not found for -lssl
Install the required system development packages \(e.g., \`libssl-dev\` on Debian/Ubuntu, \`openssl-devel\` on Fedora/RHEL\) and ensure \`pkg-config\` is installed so the build script can locate the library. Alternatively, enable the \`vendored\` feature on the relevant \`-sys\` crate \(e.g., \`openssl = \{ version = "0.10", features = \["vendored"\] \}\`\) to compile the C library statically from source.
Journey Context:
A developer adds \`reqwest\` or \`diesel\` to a fresh project on a new Linux machine or Docker container \(\`rust:latest\`\). Running \`cargo build\` proceeds to compile many crates, then fails at the linking stage with 'ld: cannot find -lssl' or 'ld: library not found for -lcrypto'. The developer realizes this is a system dependency, not a Rust crate. They install \`libssl-dev\` but the error persists because \`pkg-config\` is missing, so the build script cannot tell Cargo where to find the library. After installing both, the build succeeds. On macOS, the issue might involve missing Xcode Command Line Tools or Homebrew OpenSSL not being linked properly, requiring \`export PKG\_CONFIG\_PATH="/usr/local/opt/openssl/lib/pkgconfig"\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T05:49:37.346104+00:00— report_created — created