尝试在Mac 10.8上构建pycairo [英] Trying to build pycairo on mac 10.8

查看:213
本文介绍了尝试在Mac 10.8上构建pycairo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个Python安装.该操作系统随附的一个,以及我手动下载并安装的一个,均为2.7.

I have two Python installations. The one that came with the OS, and one I downloaded and installed manually, both are 2.7.

我手动下载的是我的默认Python. which python返回

The one I downloaded manually is my default Python. which python returns

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

我已经手动安装了开罗.

I have already installed Cairo, again, manually.

然后我下载py2cairo,转到目录并运行./waf configure,然后返回...

I then downloaded py2cairo, went to the directory and ran ./waf configure, which then returned...

  ./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,我得到这个错误

but then whey I try to do ./waf build, i get this error

     ./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}

有什么想法吗?

推荐答案

X-Windows文件位于"/usr/X11R6"中.如果没有该目录,则说明您没有安装X-Windows开发包.

The X-Windows files are in "/usr/X11R6". If you do not have that directory, you do not have the X-Windows development package installed.

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

这篇关于尝试在Mac 10.8上构建pycairo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆