Windows versions of Python---pros and cons?

P. Alejandro Lopez-Valencia dradul at yahoo.com
Fri Jun 21 21:41:05 EDT 2002


"Tom Loredo" <loredo at astro.cornell.edu> escribió en el mensaje
news:3D110B55.4D8AD7FA at astro.cornell.edu...
>
> In particular,
> I write many C extensions; can one use distutils and the Borland
> or gcc free compilers to build C extensions in both versions?

Yes, as long as it be possible to convert the link libraries from one
format to the other. Everything is explained in the distutils
documentation (I'm surprised none has mentioned this yet!!!).

In the case of the Borland compilers, you process the MSVC6 import
libraries provided in the ${PYTHONHOME}/libs directory with COFF2OMF and
add the suffix "_bcpp", like so

c:\whatever\libs > coff2omf python22.lib python22_bcpp.lib

and add the resulting libraries to the same directory where the MSVC
import libraries are located originally. To compile your extension with
Borland C++ and distutils, you just type,

c:\foo\bar > python setup.py build --compiler=bcpp

Should know, I just compiled the latest numpy CVS snapshot with BCPP
ten minutes ago ;)

If you want to use mingw32 gcc, the process is *a lot" more complicated.
See the documents I mentioned above (basically you need to extract all
the export symbols from the DLL and then create an import library based
on the exports definition file).




More information about the Python-list mailing list