You are not logged in Log in Join
You are here: Home » Members » als » random tips » building Python modules on MS Windows platform with mingw32

Log in
Name

Password

 

building Python modules on MS Windows platform with mingw32

excellent distutils module (included with python 2.0) made it very easy to build python extension modules both on posix and win32 platforms. the problem is that Python binary distributions for MS Windows do not include import libraries for popular gcc based tools: cygwin and mingw32

the good thing is that it is quite easy to make these libraries yourself. you will need:

to build an import library:

  • run pexports %dll_name% >%def_file%
  • run dlltool -d %def_file% -l %library% (please do not forget that gcc linker expects library files to have "lib" prefix, e.g. libpython20.a for python20.dll)
  • put the produced library somewhere in the library path (e.g. C:\Python20\libs)

this file contains the .def file made for python 2.0 and import library built with mingw32 gcc-2.95.2