osx – 在pkg-config搜索路径中找不到软件包cairo

在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

任何线索在这里出了什么问题?

UPDATE

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
最佳答案
解决我的问题更容易. ubuntu依赖关系安装不正确,您可以在这里找到说明:

https://github.com/LearnBoost/node-canvas/wiki

这对我有用:

sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++

转载注明原文:osx – 在pkg-config搜索路径中找不到软件包cairo - 代码日志