pkg-config on Mac Doesn't find Libraries

I figured this out. Apparently packages that use pkg-config create a .pc file in the highest-level directory that is created after untaring source code for library Y.

Then, if library Z complains that it cannot find library Y, and it uses pkg-config, set the PKG_CONFIG_PATH variable to point to the directory which contains the .pc file.

In my case, libxml++ relies on libxml2, so when configuring libxml++, I have to point the path to the .pc file created by libxml2:

export PKG_CONFIG_PATH=/Users/ryan/SVN/packages/libxml2-2.7.3/

Then configure works correctly.


you have to set PKG_CONFIG_PATH to exactly where the library is, such as xyz.so is not in /usr/lib but /usr/lib/xyz so you need to extend the path to include it...

export PKG_CONFIG_PATH = $PKG_CONFIG_PATH:/usr/lib/xyz

Stuart

Tags:

Path

Mac Osx