pkg-config "No package 'x' found" in CI
pkg-config looks up a library through its .pc metadata file. "No package 'x' found" means no matching .pc file is on the pkg-config search path, typically because the library dev package is not installed or lives in a prefix not on PKG_CONFIG_PATH.
What this error means
A configure or build step fails with "Package 'x' was not found in the pkg-config search path" and "No package 'x' found", stopping before compilation or linking.
Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'openssl' foundCommon causes
The dev package that ships the .pc file is missing
The runtime library may be present, but the -dev/-devel package that installs x.pc is not, so pkg-config finds no metadata.
The .pc file is in a prefix not on PKG_CONFIG_PATH
A package manager installed the library under a custom prefix whose pkgconfig directory is not on the search path.
How to fix it
Install the dev package
Add the development package that provides the .pc file.
sudo apt-get update
sudo apt-get install -y libssl-devAdd the pkgconfig directory to PKG_CONFIG_PATH
Point pkg-config at the prefix where the .pc file lives.
export PKG_CONFIG_PATH="$VCPKG_ROOT/installed/x64-linux/lib/pkgconfig:$PKG_CONFIG_PATH"
pkg-config --cflags --libs opensslHow to prevent it
- Install
-devpackages so their.pcfiles exist. - Set
PKG_CONFIG_PATHfor libraries in custom prefixes. - Verify with
pkg-config --exists xearly in the job.