[Distutils] Compiling C++ extensions with python2.3 distutils/mingw32 fails

Hogendoorn, Rene r.hogendoorn at hitt.nl
Fri Sep 5 15:10:53 EDT 2003

The distutils, distributed with python 2.3, try to recognize the language (c
or c++) and set the linker executable as
With cygwin and mingw32, the resulting linker is 'cc.exe', because the
CygwinCompiler class fails to provide a
definition for compiler_cxx.
A solution is to patch the call to self.set_executables:
        # Hard-code GCC because that's what this is all about.
        # XXX optimization, warnings etc. should be customizable.
        self.set_executables(compiler='gcc -mcygwin -O -Wall',
                                       compiler_so='gcc -mcygwin -mdll -O
                                       compiler_cxx='g++ -mcygwin -O -Wall',
                                       linker_exe='gcc -mcygwin',
                                       linker_so=('%s -mcygwin %s' %

René Hogendoorn

HITT Traffic
Oude Apeldoornseweg 41-45
P.O. Box 717
The Netherlands 
Telephone	+31-55-543 2559
Mobile		+31-610 925 412
Fax		+31-55-543 2553
E-mail		r.hogendoorn at hitt.nl 

More information about the Distutils-SIG mailing list