building extensions with gcc and python 2.2

Gerhard Häring gerhard.haering at
Mon Oct 14 19:24:19 CEST 2002

Ken Seehof wrote in comp.lang.python:
> Chris wrote:
>>martin at (Martin v. Loewis) wrote in
>>news:m3k7kmqgfn.fsf at
>> > Ken Seehof <kseehof at> writes:
>> >
>> >> Should I use Cygwin or Mingw?
>> >
>> > If you use Cygwin, your users will need a complete Cygwin
>> > installation, including the Python that comes with cygwin; you will
>> > not be able to use your extension modules with PythonLabs Python,
>> > ActivePython, or the Win32 extensions.
>>i use gcc from cygwin with --compiler=mingw and the extensions work
>>perfectly with the dist.
> What's the significance of --compiler setting versus where gcc is from?

The "--compiler" setting is for _distutils_.

> Do you have an example project that I can see? I don't have prior experience
> with gcc (I've spent way too much time in Microsoft land :-).

As for an example project, PySQLite, pyPgSQL, MySQLdb can all be built
with mingw32. 98.43 % of the Python extensions that can be built with
MSVC work with mingw as well ;-)

>>whats certainly speaks for mingw instead of cygwin is the download size.
>>cygwin is great when you want the posix emualtion but native win32 dlls are
>>probably what Ken wants when he used VC++ before and for that is mingw.
>> > If you use Mingw, it probably will not work without tricks being done
>> > to the import library.
>>yes, one needs to build the own one with pexports and dlltool. but thats
>>easy and has only to be done once.

Yep. Check the section in the Python docs about "Non-MS compilers."

> Is this required if I use gcc from cygwin with --compiler=mingw?
> If so, what tricks do I need to do?

python build --compiler=mingw32


-- Gerhard

More information about the Python-list mailing list