在OS X Lion上安装Cairo [英] Installing Cairo on OS X Lion

查看:80
本文介绍了在OS X Lion上安装Cairo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在使用Python 2.7.2的OS X Lion上安装Cairo时,它无法正常工作,我可以构建和安装它,但是在python中导入cairo时找不到.我已经尝试过如何安装PyCairo在Mac OSX上使用默认的1.10版本,它只会产生此错误

When I try to install Cairo on OS X Lion with Python 2.7.2 it just does not work, I can build and install it, but when it comes to import cairo in python it can't be found. I have tried the How to install PyCairo 1.10 on Mac OSX with default and it just produces this error

 "_cairo_xlib_surface_get_width", referenced from:
  _xlib_surface_get_width in surface.c.1.o

ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/l9/71rhp2vs7w34bm4x6mfwms500000gn/T//cc1fcO7s.out (No such file or directory)
Waf: Leaving directory `/Users/andrewlynch/Downloads/py2cairo-1.10.0/build_directory'
Build failed
 -> task failed (exit status 1): 
    {task 4550820944: cshlib cairomodule.c.1.o,context.c.1.o,font.c.1.o,path.c.1.o,pattern.c.1.o,matrix.c.1.o,surface.c.1.o -> _cairo.so}
['/usr/bin/gcc', 'src/cairomodule.c.1.o', 'src/context.c.1.o', 'src/font.c.1.o', 'src/path.c.1.o', 'src/pattern.c.1.o', 'src/matrix.c.1.o', 'src/surface.c.1.o', '-o', '/Users/andrewlynch/Downloads/py2cairo-1.10.0/build_directory/src/_cairo.so', '-L/usr/local/Cellar/cairo/1.10.2/lib', '-lcairo', '-lpython2.7', '-dynamiclib', '-Wl,-F.', '-arch', 'i386', '-arch', 'x86_64', '-Wl,-F.', '-Wl,-F.', '-arch', 'i386', '-arch', 'x86_64', '-arch', 'i386', '-arch', 'x86_64']}

推荐答案

在尝试在OSX Lion上安装PyCairo时,我有类似的经历.默认安装尝试使用体系结构i386进行安装.您需要将其更改为64位体系结构x86_64.

I had a similar experience while trying to install PyCairo on OSX Lion. The default install tries to use architecture i386 to install. You need to change this to the 64bit architecture, x86_64.

我尝试将 CFLAGS CXXFLAGS 设置为"arch x86_64",但这没有用.为了使其正常工作,我必须将 ARCHFLAGS 设置为此值.

I tried setting the CFLAGS and CXXFLAGS to 'arch x86_64', but this didn't work. To make it work, I had to set ARCHFLAGS to this value.

export ARCHFLAGS="-arch x86_64"

希望这能为您解决问题.

Hopefully, this will solve the problem for you.

这篇关于在OS X Lion上安装Cairo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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