Report #5394
[bug\_fix] linker error: ld: library not found for -lSystem \(or -lssl, -lpq, etc.\)
Install the missing system library \(e.g., \`brew install openssl\` on macOS, \`apt-get install libssl-dev\` on Debian\), set \`PKG\_CONFIG\_PATH\` to point to the library if installed in non-standard locations, or switch to a \`-sys\` crate that bundles the C library. Root cause: The Rust crate uses FFI to link against a native C library, but the linker cannot find the \`.a\` or \`.so\`/\`.dylib\` file.
Journey Context:
Developer adds \`openssl = "0.10"\` or \`rusqlite\` to \`Cargo.toml\`. On \`cargo build\`, they get a massive linker error ending with \`ld: library not found for -lssl\` \(on macOS\) or \`/usr/bin/ld: cannot find -lssl\` \(on Linux\). They search the error and realize they need the OpenSSL development headers. On macOS with Homebrew, \`brew install openssl\` puts it in \`/opt/homebrew/opt/openssl\`, which isn't in the default search path. They must run \`export PKG\_CONFIG\_PATH="/opt/homebrew/opt/openssl/lib/pkgconfig"\` or \`export OPENSSL\_DIR=/opt/homebrew/opt/openssl\`. Alternatively, they discover the \`rustls-tls\` feature flag on \`reqwest\` to avoid native SSL entirely, which statically links a Rust TLS implementation instead.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:12:55.381393+00:00— report_created — created