-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Kern wrote:
> Tres Seaver wrote:
>
>>I can't help about the particulars, but it is very important that binary
>>extensions be built with *exactly* the same compiler / C runtime library
>>as the Python interpreter. In your case, unless you built Python from
>>source using mingw (as well as lxml), I wouldn't expect anything other
>>than segfaults / access violations.
>>
>>The toolchain for "stock" Python was VC++ version 6 (for Python 2.3.x),
>>or VC++ version 7 (for Python >= 2.4).
>
>
> <sigh> No it isn't necessary to use exactly the same compiler. It *is*
> necessary to use the same C runtime library. For Python 2.4, make sure
> everything is linked with msvcr71.dll . You may have to change gcc's
> spec file: replace "-lmsvcrt" with "-lmsvcr71". You may want to compile
> libxml2 and libxslt yourself to be sure.
In theory, I suppose it would be possible to make stuff compiled with
different compilers work, assuming that they used the same header files
for the libraries (since calling conventions et. al are part of the
signatures).
In practice, I would still rather build Python itself from source, or
else build the extensions with the same environment used to build
Python, rather than spend *any* time wondering if I had managed to get
the planets to align; note that this is *exactly* how I use Python on
Unix, for anything other than short-running scripts (I *never* run Zope
using the OS / distribution's /usr/bin/python).
> It's kinda nice to see the problems I solved 6 years ago still haunting
> people, though. Makes me feel all nostalgic.
I'm assuming that your writeup,
http://starship.python.net/crew/kernr/mingw32/Notes.html , is still
relevant? That document points to
http://www.python.org/doc/current/ext/building-on-windows.html,
which notes:
Module authors are encouraged to use the distutils approach for
building extension modules, instead of the one described in this
section. You will still need the C compiler that was used to build
Python; typically Microsoft Visual C++.
I do know that Tim Peters makes binaries available for the Python
extensions in ZODB / Zope2 / Zope3, precisely so that people can test
those packages on Windows without having the "canonical" toolchain
installed.
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver@xxxxxxxxxxxxx
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDUt/U+gerLs4ltQ4RAlD9AKCirx+sazU8sGgMm2KkB2kFII42oQCfWEyi
kyTyLB4Oigr3Hkh/Qwi+MPE=
=q+C5
-----END PGP SIGNATURE-----
|
|