Original Translation
217
GNU C / Cygwin / MinGW
218
These instructions only apply if you're using a version of Python prior to 2.4.1 with a MinGW prior to 3.0.0 (with binutils-2.13.90-20030111-1).
219
This section describes the necessary steps to use Distutils with the GNU C/C++ compilers in their Cygwin and MinGW distributions. [#]_ For a Python interpreter that was built with Cygwin, everything should work without any of these following steps.
220
These compilers require some special libraries. This task is more complex than for Borland's C++, because there is no program to convert the library. First you have to create a list of symbols which the Python DLL exports. (You can find a good program for this task at http://www.emmestech.com/software/pexports-0.43/download_pexports.html).
221
pexports python25.dll >python25.def
222
The location of an installed :file:`python25.dll` will depend on the installation options and the version and language of Windows. In a "just for me" installation, it will appear in the root of the installation directory. In a shared installation, it will be located in the system directory.
223
Then you can create from these information an import library for gcc. ::
224
/cygwin/bin/dlltool --dllname python25.dll --def python25.def --output-lib libpython25.a
225
The resulting library has to be placed in the same directory as :file:`python25.lib`. (Should be the :file:`libs` directory under your Python installation directory.)
226
If your extension uses other libraries (zlib,...) you might have to convert them too. The converted files have to reside in the same directories as the normal libraries do.