[cairo] Compiling Cairo for unicode ucs2

Dave Coventry dgcoventry at gmail.com
Wed May 16 14:07:24 PDT 2012


I've been using a Hidden line removal python script which uses cairo,
but I'm getting the following error:

/usr/lib/python2.6/dist-packages/cairo/_cairo.so: undefined symbol:

Apparently I need to compile cairo with Python compiled to ucs2.

I've downloaded pycairo-1.10.0.tar.bz2, extracted to
/opt/pycairo-1.10.0 and then run ./waf configure which gives the
following results:

Murray py2cairo-1.10.0 # ./waf configure
Setting top to                           : /opt/py2cairo-1.10.0
Setting out to                           : /opt/py2cairo-1.10.0/build_directory
Checking for 'gcc' (c compiler)          : ok
Checking for program python              : /usr/bin/python
Checking for python version              : (2, 7, 2, 'final', 0)
Checking for library python2.7           : yes
Checking for program python2.7-config    : /usr/bin/python2.7-config
Checking for header Python.h             : yes
Checking for program pkg-config          : /usr/bin/pkg-config
Checking for 'cairo' >= 1.10.0           : yes
PREFIX                                   : /usr/local
LIBDIR                                   : /usr/local/lib
'configure' finished successfully (0.984s)

Clearly the version that cairo is compiling against is python2.7 and
my PyUnicodeUCS4_AsUTF8String error is against Python2.6.

But when I run waf with python2.6 it appears to compile against python2.7:

Murray py2cairo-1.10.0 # python2.6 waf install
Waf: Entering directory `/opt/py2cairo-1.10.0/build_directory'
- install /usr/local/include/pycairo/pycairo.h (from src/pycairo.h)
[ 2/12] subst: pycairo.pc.in -> pycairo.pc
+ install /usr/local/lib/python2.7/site-packages/cairo/_cairo.so (from
+ install /usr/local/lib/pkgconfig/pycairo.pc (from pycairo.pc)
Waf: Leaving directory `/opt/py2cairo-1.10.0/build_directory'
- install /usr/local/lib/python2.7/site-packages/cairo/__init__.py
(from src/__init__.py)
+ byte compiling '/usr/local/lib/python2.7/site-packages/cairo/__init__.py'
'install' finished successfully (0.318s)

How do I compile Cairo against the correct Unicode version?

Kind Regards,

Dave Coventry

More information about the cairo mailing list