在 Mac OS X 1.7.5 / Lion 上
我正在尝试使用自制软件安装 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