2013-10-10 81 views
14

在Mac OS X 1.7.5 /獅子包開羅沒有在pkg配置搜索路徑發現

我嘗試使用安裝包開羅自制

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/: 

(source .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 

回答

5

ln -s /usr/local/Cellar/cairo/1.12.16/lib/pkgconfig/cairo.pc /usr/local/lib/pkgconfig/cairo.pc

解決了我的問題

+1

大家好,我的問題是與你相似,只有當我執行你的命令它說,該文件已經存在,當我嘗試建立rrdtool的安裝(使用開羅)仍不能在pkgconfig找到它。 是否有一套我應該運行所有命令的命令? 還有什麼可能讓我達到預期效果嗎? – AKFourSeven

+0

我在/ usr/local/path下沒有Cellar文件夾,並且安裝了libcairo2。 –

3

可以使用PKG_CONFIG_PATH的一樣。 I.e .:

PKG_CONFIG_PATH=/usr/local/Cellar/cairo/1.12.16/lib/pkgconfig ./configure .... 
13

解決我的問題更容易。 Ubuntu的依賴只是沒有正確安裝,你可以在這裏找到說明:

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

這是對我工作:

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

當你低調時,請留下評論什麼沒有工作,所以我們可以改善答案。簡單的投票對任何人都沒有用處。 – Milimetric

+1

apt-get不適用於mac – hoangpx

+1

對,對於我不知道的mac,但我想它可以用來安裝這些庫的等價物,或者這個問題是完全不同的。 – Milimetric

2

我對優勝美地這個問題,並固定它重新安裝開羅。

$ brew unlink cairo 
Unlinking /usr/local/Cellar/cairo/1.14.2... 30 symlinks removed 
$ brew install cairo