Report #84450
[bug\_fix] ld: library not found for -l
Install the required system development packages \(e.g., \`libssl-dev\`, \`postgresql-dev\`\) that provide the C headers and static/shared libraries, or set environment variables like \`PKG\_CONFIG\_PATH\` to help the build script locate them. The root cause is that a \`-sys\` crate \(like \`openssl-sys\`\) uses a build script to link to native C libraries, and the linker cannot find the binary artifacts on the system.
Journey Context:
You add a dependency like \`reqwest\` or \`diesel\` with the \`postgres\` feature to your \`Cargo.toml\`. You run \`cargo build\` and get a wall of linker errors mentioning \`ld: cannot find -lssl\` or \`ld: cannot find -lpq\`. You realize that while you have the runtime libraries, you lack the development headers. On Ubuntu, you run \`sudo apt install libssl-dev libpq-dev\`, on macOS you might \`brew install openssl\` and export \`PKG\_CONFIG\_PATH\`. You rebuild, and the build script in the \`-sys\` crate now finds the library, emitting the correct \`-L\` flag to the linker.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:20:39.230923+00:00— report_created — created