2012-11-17 38 views
1

我有兩個Python安裝。操作系統附帶的一個,我手動下載和安裝的一個都是2.7。試圖在mac上構建pycairo 10.8

我手動下載的是我的默認Python。 which python回報

/Library/Frameworks/Python.framework/Versions/2.7/bin/python

我已經安裝了開羅,再次手動。

我然後下載py2cairo,跑到目錄就跑./waf configure,然後返回...

./set_options 
    ./init 
    ./configure 
Checking for program gcc or cc   : /usr/bin/gcc 
Checking for program cpp     : /usr/bin/cpp 
Checking for program ar     : /usr/bin/ar 
Checking for program ranlib    : /usr/bin/ranlib 
Checking for gcc       : ok 
Checking for program python    :/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 
Checking for Python version >= 2.6.0  : ok 2.7.3 
Checking for library python2.7   : yes 
Checking for program python2.7-config :/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config 
Checking for header Python.h    : yes 
Checking for cairo >= 1.8.10    : yes 
'configure' finished successfully (0.978s) 
    ./shutdown 

但隨後乳清我嘗試做./waf build,我得到這個錯誤

 ./set_options 
    ./init 
Waf: Entering directory '/Users/jose/Downloads/pycairo-build' 
    ./build 
    src/build 
[7/9] cc: src/surface.c -> ../pycairo-build/default/src/surface_2.o 
In file included from ../pycairo-1.8.10/src/surface.c:1360: 
/usr/local/include/cairo/cairo-xlib.h:44:22: error: X11/Xlib.h: No such file or directory 
In file included from ../pycairo-1.8.10/src/surface.c:1360: 
/usr/local/include/cairo/cairo-xlib.h:49: error: expected ‘)’ before ‘*’ token 
/usr/local/include/cairo/cairo-xlib.h:56: error: expected ‘)’ before ‘*’ token 
/usr/local/include/cairo/cairo-xlib.h:69: error: expected declaration specifiers or ‘...’ before ‘Drawable’ 
/usr/local/include/cairo/cairo-xlib.h:73: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
/usr/local/include/cairo/cairo-xlib.h:77: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cairo_xlib_surface_get_drawable’ 
/usr/local/include/cairo/cairo-xlib.h:79: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
/usr/local/include/cairo/cairo-xlib.h:82: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
Waf: Leaving directory `/Users/jose/Downloads/pycairo-build' 
Build failed: -> task failed (err #1): 
    {task: cc surface.c -> surface_2.o} 

有任何想法嗎?

回答

2

X-Windows文件位於「/ usr/X11R6」中。如果您沒有該目錄,則沒有安裝X-Windows開發包。

https://trac.macports.org/wiki/InstallingMacPorts#a2.InstallXWindowsX11

+0

謝謝,但我已經安裝了X11,仍然無法正常工作......我需要鏈接呢? – Jose187

+1

X11 SDK是Apple開發人員工具安裝程序的一部分,現在稱爲Xcode工具(https://developer.apple.com/xcode/)。 那麼你有沒有安裝Xcode的所有可用選項呢? – namit

+0

沒錯,就是這樣。我確實安裝了它,但轉移到Mountain Lion卸載它。所以我又做了它,它的工作!謝謝。 – Jose187