M2Crypto build error - _lib.h:5: error: redefinition of typedef 'Py_ssize_t'

Philip Kershaw <[email protected]>
Newsgroups gmane.comp.python.cryptography
Organization RAL
Message-ID <[email protected]>
Hello,

I'm getting a strange error installing M2Crypto on Redhat:

In file included from SWIG/_m2crypto_wrap.c:2528:
/tmp/easy_install-F8-kVi/m2crypto-0.18.1/SWIG/_lib.h:5: error: redefinition of 
typedef 'Py_ssize_t'

Has anyone seen anything similar?

I've tried different SWIG versions: 1.3.30, 1.3.30rc1, 1.3.31 but still the 
same result.   Originally the machine had SWIG 1.3.21.  The build worked with 
this but I noticed that the M2Crypto INSTALL file lists > 1.3.24 as a 
prerequisite.

Other details ...

Python version is 2.4.4.

Redhat version info:

# cat /proc/version
Linux version 2.6.9-42.0.2.ELsmp ([email protected]) (gcc 
version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Thu Aug 17 18:00:32 EDT 2006

It works without any problems on Ubuntu:

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

The only other thing I can see is there is an earlier version of gcc on the 
Redhat machine.

Full output from easy_install below...

Cheers,
Phil

# easy_install M2Crypto
Searching for M2Crypto
Reading http://pypi.python.org/simple/M2Crypto/
Reading http://chandlerproject.org/Projects/MeTooCrypto
Reading http://sandbox.rulemaker.net/ngps/m2/
Reading http://www.post1.com/home/ngps/m2
Reading http://wiki.osafoundation.org/bin/view/Projects/MeTooCrypto
Best match: m2crypto 0.18.1
Downloading 
http://chandlerproject.org/pub/Projects/MeTooCrypto/m2crypto-0.18.1.tar.gz
Processing m2crypto-0.18.1.tar.gz
Running m2crypto-0.18.1/setup.py -q 
bdist_egg --dist-dir /tmp/easy_install-F8-kVi/m2crypto-0.18.1/egg-dist-tmp-5IrhAu
SWIG/_bio.i:62: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_rand.i:19: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_evp.i:148: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_dh.i:35: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_rsa.i:43: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_dsa.i:31: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_ssl.i:201: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_x509.i:302: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_pkcs7.i:40: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_pkcs7.i:40: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_util.i:9: Warning(454): Setting a pointer/reference variable may leak 
memory.
SWIG/_ec.i:111: Warning(454): Setting a pointer/reference variable may leak 
memory.
In file included from SWIG/_m2crypto_wrap.c:2528:
/tmp/easy_install-F8-kVi/m2crypto-0.18.1/SWIG/_lib.h:5: error: redefinition of 
typedef 'Py_ssize_t'
SWIG/_m2crypto_wrap.c:782: error: previous declaration of 'Py_ssize_t' was 
here
SWIG/_m2crypto_wrap.c:5724: warning: function declaration isn't a prototype
SWIG/_m2crypto_wrap.c: In function `make_stack_from_der_sequence':
SWIG/_m2crypto_wrap.c:5828: warning: function declaration isn't a prototype
error: Setup script exited with error: command 'gcc' failed with exit status 1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.