Unintuitive error message for missing .pc file
Submitted by Bill Spitzak
Assigned to pkg..@..op.org
Description
If a .pc file is missing, it prints an error saying "Perhaps you should add the directory containing 'foo.pc' to PKG_CONFIG_PATH environment variable".
In 100% of the cases I have encountered this is not what is wrong. In every one of them the solution is to add 'foo.pc' to a directory already existing in PKG_CONFIG_PATH or the built-in path (by installing the missing package).
A better message is:
'foo.pc' not found in $PKG_CONFIG_PATH or /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
This should indicate that in the rare case of the file already existing that fixing the environment variable PKG_CONFIG_PATH will work. It also shows the search path, which is hard to find out otherwise.