在Mac OS X 1.7.5 / Lion上,我正在尝试使用Homebrew安装cairo软件包。
brew install cairo => PASSED
==> Downloading http://cairographics.org/releases/cairo-1.12.16.tar.xz
Already downloaded: /Library/Caches/Homebrew/cairo-1.12.16.tar.xz
==> ./configure --prefix=/usr/local/Cellar/cairo/1.12.16 --with-x --enable-gobject=yes
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.
Mac OS X already provides this software in versions before Mountain Lion.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/cairo/lib
CPPFLAGS: -I/usr/local/opt/cairo/include
==> Summary
/usr/local/Cellar/cairo/1.12.16: 105 files, 8.0M, built in 2.5 minutes
当我尝试编译我的代码时,我仍然会得到这个错误:
+++ Precompile
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
Package 'cairo', required by 'pangocairo', not found
因此,我相应地调整了我的PKG_CONFIG_PATH。
PKG_CONFIG_PATH=/usr/local/opt/cairo/lib/pkgconfig/:/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig/:
(源 .bash_profile)
尝试重新编译,但是我遇到了完全相同的错误。
验证该文件是否存在于 pkgconfig 目录中... 确实存在。
ls /usr/local/opt/cairo/lib/pkgconfig/
cairo-fc.pc cairo-gobject.pc cairo-png.pc cairo-quartz-font.pc cairo-script.pc cairo-xcb-shm.pc cairo-xlib-xrender.pc cairo.pc
cairo-ft.pc cairo-pdf.pc cairo-ps.pc cairo-quartz.pc cairo-svg.pc cairo-xcb.pc cairo-xlib.pc
这里有什么问题?有线索吗?
更新
我的系统中cairo.pc位于两个位置。我已尝试在我的pgg配置路径中使用每个位置,但没有成功。
find /usr -name cairo.pc
/usr/local/Cellar/cairo/1.12.16/lib/pkgconfig/cairo.pc
/usr/X11/lib/pkgconfig/cairo.pc
pkg-config --variable pc_path pkg-config
/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig