Compiling python extensions on Windows

Richard P. Muller rpm at
Sun May 27 22:07:24 CEST 2001

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

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

(1) Is there an easy workaround for this in Cygwin? I'm a Unix kinda
guy, so I prefer this as a development environment.

(2) If not, I have access to several other build environments
(Codewarrior, Microsoft VisualStudios). Does anyone know which
environment was used to build Python2.1 on windows? Are there easy to
follow instructions anywhere for the build (I assume that "./configure"
doesn't work on windows)?

Thanks in advance.

Richard P. Muller, Ph.D.
rpm at

More information about the Python-list mailing list