Whilst attempting to compile poppler from source I get the error Package "fontconfig" not found.

I have found a lot of other resources advertising that this can be fixed by installing both pkg-config and libfontconfig1-dev to get the libraries, but I still got the error.

Trying to install fontconfig from source failed at the make step and I've found no resources on how to fix (whole host of C errors).

If I have fontconfig on the system (and apt seems to suggest I do) how can I use it when running ./configure for a package?

4 Answers 4


Whenever you get messages about missing packages (or suggestions to modify your PKG_CONFIG_PATH) during a build, it usually indicates that you are missing the corresponding development package - which is typically separate from the runtime package that is normally installed on the system.

In this case you have the most recent version of fontconfig but are probably missing the corresponding libfontconfig1-dev package.

src: https://askubuntu.com/questions/536714/autogen-sh-cant-find-fontconfig-package

  • 1
    In the question: “this can be fixed by installing both pkg-config and libfontconfig1-dev to get the libraries, but I still got the error.”
    – Jeff Schaller
    Commented Dec 14, 2017 at 2:09
  • What is the error that you are getting ? Commented Dec 15, 2017 at 6:21
  • 2
    On Centos 7 I needed to yum -y install fontconfig-devel to get the missing dependency. Thank you! Commented Jan 8, 2018 at 17:18
  • Yeah, apt-file claimed I had it. A look at the directory showed it wasn't there. I ran "sudo apt-get install libfontconfig-dev" and then it was there. Commented Dec 10, 2020 at 15:59
  • Solved my problem. Just didn't have the dev version.
    – Emobe
    Commented Jan 30, 2023 at 22:18

The key here turned out to be the PKG_CONFIG_PATH environment variable. This was empty on a standard shell session on my system.

There seem to be lots of directories with pkgconfig in the name, but to find the correct one I was able to use apt-file per this thread i.e.

$ apt-file search fontconfig.pc libfontconfig1-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/fontconfig.pc

Then run

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig

And now the ./configure step can find the .pc file which it requires for that library. Learning about apt-file seems to be a useful outcome of this problem.


I'm under Ubuntu 16.04 LTS 64-bits. I got this error while compiling the NAEV game and I looked at the answers listed here.

I searched for fontconfig.pc, it was found and I set PKG_CONFIG_PATH to the proper path, to no avail.

libfontconfig1-dev was actually listed as installed.

After looking at other sites, I however re-ran sudo apt-get install libfontconfig-dev to be sure, it told me it would actually install libfontconfig1-dev, so I confirmed. Then I unset PKG_CONFIG_PATH to be sure to test in the original configuration, and ran ./configure : it worked.

So my answer for such errors is the following : even if your system says the missing package is installed and finds the pc file, reinstall it by the book, there might be a glitch somewhere reinstall can fix...


Installing libfontconfig1-dev solved the issue for me.

sudo apt install libfontconfig1-dev

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .