pkg-config Error: Package `<lib>` was not found in the pkg-config search path

`.pc` metadata file is missing because only runtime `.so` (not `-dev`) is installed.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: pkg-config Error Platform: C/C++
Common Root Causes:
  • `.pc` metadata file is missing because only runtime `.so` (not `-dev`) is installed.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Install the `-dev` package or export `PKG_CONFIG_PATH=/usr/local/lib/pkgconfig`.
Safe Diagnostic Command:
pkg-config --list-all | grep -i <lib>
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

`.pc` metadata file is missing because only runtime `.so` (not `-dev`) is installed. Recommended diagnostic: `pkg-config --list-all | grep -i <lib>`. Remediation: Install the `-dev` package or export `PKG_CONFIG_PATH=/usr/local/lib/pkgconfig`.

Worked Examples

  • Run `pkg-config --list-all | grep -i <lib>` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-cpp-pkg-config-not-found · Independently verified: 2026-11-25

Related Resources