Debian – Not clear where pkg-config is finding information or how .pc files are named

debianpkg-config

I followed a tutorial on GTK which used this command to generate the build flags:

$ pkg-config --cflags --libs gtk+-3.0

This outputs coherent flags. From research, I have found that pkg-config searches for .pc files in /usr/lib/pkginfo, usr/share/pkgconfig, in the /local equivalents, and in the folder indicated by the PKG_CONFIG_PATH variable.

None of the folders contains the GTK file and the environment variable is not set. Where is pkg-config getting the flags?

Best Answer

It’s finding them in /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-3.0.pc (assuming you’re on amd64). On Debian, pkg-config also searches the multi-arch directory for the target, i.e. /usr/lib/$(dpkg-architecture -q DEB_TARGET_MULTIARCH)/pkgconfig.

Related Question