Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed a library via apt but it added no .pc file to the pkg-config dir. When I built another manually it got added. Is there a convention for libs automatically creating a .pc file and if so when and how is it done?

share|improve this question

Like .so symlinks and .h header files, the .pc files are not be shipped in libXXX debian packages, but in the accompanying libXXX-dev packages as they are only useful when developing against that library.

share|improve this answer
It was the dev package I installed via apt, yet no .pc file? – user1561108 Mar 25 '13 at 9:36
(package - libboost1.42-dev) – user1561108 Mar 25 '13 at 9:37
Boost doesn't ship .pc files as it installs headers etc. in /usr/, so the compiler will find them without extra flags. – Dennis Kaarsemaker Mar 25 '13 at 9:42
Ditto. Not everything uses pkg-config. Some of boost does require a linker flag, but you don't need a .pc file for any of this -- altho if you google "libboost pkg-config" you'll find some debate from downstream packagers. – goldilocks Mar 25 '13 at 9:46
I had to add '-lboost_filesystem' flag when compiling my src for that lib, is that expected? – user1561108 Mar 25 '13 at 11:23

Yes you should always do that.

For users who use your library, pkg-config --libs --cflags libmtp is always easier than appending these flags manually, and they don't need to guess the dependency of your library.

And I don't think there's a way automating it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.