Compiling python extensions on Windows

Gerhard Häring gerhard.nospam at
Sun May 27 14:51:45 EDT 2001

On Sun, 27 May 2001 13:07:24 -0700, Richard P. Muller wrote:
>I have a set of math functions I use to speed up some of my Python work.
>The functions compile easily on Linux/Unix, but I've had problems
>getting them to compile on Windows using Cygwin.
>When trying to include Python.h, I get the error message:
>gcc  -Ic:/Python21/include -c dmatrix.c
>In file included from c:/Python21/include/Python.h:54,
>                 from dmatrix.c:9:
>c:/Python21/include/pyport.h:422: #error "LONG_BIT definition appears
>wrong for platform (bad gcc/glibc config?)."
>make: *** [dmatrix.o] Error 1

If you want to compile with Cygwin gcc, you need to install the Cygwin Python
2.1 port. It's available in Cygwin's contrib directory (since a few weeks ago).
Just run the Cygwin setup program again and you should be able to install
Python 2.1 from there.

>This makes me believe that cygwin has a different definition of LONG_BIT
>than does the compiler with which Python2.1 was compiled.

Yes, the Win32 Python distributions are compiled with Microsoft Visual C++.

mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:              public key at homepage
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

More information about the Python-list mailing list