[PYTHON-CRYPTO] M2Crypto build error - _lib.h:5: error: redefinition of typedef 'Py_ssize_t'

Philip Kershaw p.j.kershaw at RL.AC.UK
Wed Oct 17 15:16:14 CEST 2007


On Tuesday 16 October 2007 18:32, Heikki Toivonen wrote:
> Philip Kershaw wrote:
> > but I have to miss out the swig step as it overwrites _m2crypto_wrap.c. 
> > Given this I'm guessing it's a bug in swig's generation of the wrap file.
>
> Ok. What is your exact linux distro, and swig version? I believe I saw
> mentions on the SWIG website that they had fixed Python 2.5 issues in
> 1.3.30 or something. I may need to add some info to M2Crypto page/build
> instructions about Python 2.5 requiring a newer SWIG...

I think I've tracked it down to swig 1.3.30rc1.  This didn't have the correct 
#if statement for Py_ssize_t as of PEP 353.  It's fixed correctly in 1.3.30 
and 1.3.31.  

The combination that failed was:

swig 1.3.30rc1 + Python 2.4.4 + M2Crypto 0.18.2

Python 2.5 works fine regardless of swig version.

For the record the distros I used were Redhat Enterprise and Ubuntu:

Redhat ...
# cat /proc/version
Linux version 2.6.9-42.0.2.ELsmp (bhcompile at ls20-bc1-13.build.redhat.com) (gcc 
version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Thu Aug 17 18:00:32 EDT 2006

# cat /etc/redhat-release
Red Hat Enterprise Linux WS release 4 (Nahant Update 5)

Ubuntu ...
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 6.06 LTS
Release:        6.06
Codename:       dapper

$ cat /proc/version
Linux version 2.6.15-23-386 (buildd at rothera) (gcc version 4.0.3 (Ubuntu 
4.0.3-1ubuntu5)) #1 PREEMPT Tue May 23 13:49:40 UTC 2006

Cheers,
Phil



More information about the python-crypto mailing list