Fontconfig error: cannot load default config file

Solution 1:

You need to set the $FONTCONFIG_PATH properly. Usually it is set in /etc/profile but, if you are executing the command from a non login shell (e.g., through cron), then you need to set it explicitly by doing the following:

export FONTCONFIG_PATH=/etc/fonts

Solution 2:

Just before fontconfig is built, it is configured. This hard codes the paths where it looks for various files. The fontconfig your program is linked to is not configured correctly. Fontconfig should be configured like this:

./configure --enable-static --sysconfdir=/etc --localstatedir=/var

This will make fontconfig look for fonts.conf in /etc/fonts instead of /data/jenkins/pms-deps-universal/BUILD_TAG/linux-ubuntu-i686/output/pms-depends-linux-ubuntu-i686-release-8400c3b/etc/fonts.