RELEASED Python 2.4, alpha 1

Paul Moore pf_moore at yahoo.co.uk
Sun Jul 11 10:14:04 EDT 2004


[For some reason, this posting never appeared. Here's another try -
apologies if it appears twice]

"Terry Reedy" <tjreedy at udel.edu> writes:

>> I don't think anybody has demonstrated yet that you can actually build
>> extensions with the Microsoft compiler that is free of charge.
>
> Which means that reports on experiments attempting to do so would be a
> service to the community ;-)

Hmm. I have just done some basic experimentation.

I have 4 C compilers installed, on Windows XP Pro.

1. Microsoft Visual C++ 6
2. Mingw
3. Microsoft .NET SDK (non-optimising C compiler)
4. Microsoft Visual C++ Toolkit 2003

I do not have Visual Studio .NET (any version) installed.

Of these, (1) is not suitable for building extensions for the
python.org Python 2.4, because of CRT differences (as we know).

Also, (4) is not suitable, as it only supports static libraries for
the CRT, and hence not msvcr71.

As I've reported, (a suitably recent version of) mingw works (with a
patch to distutils).

The remaining option is (3). This can build msvcr71-compatible DLLs,
and so should be an option.

I set up my environment to point to the .NET SDK (so that the cl
command executes the .NET SDK compiler). Then, I tried python setup.py
build on a small extenson I had to hand. The result was that I got the
following error:

error: Python was built with version 7.1 of Visual Studio, and
extensions need to be built with the same version of the compiler, but
it isn't installed.

Apparently, distutils is looking in the registry, and finding MSVC6 (I
know it does this, as it can build with an installed Visual Studio
even if the environment variables are not set up). It does not,
apparently, notice that the PATH includes a later "cl" command, which
is suitable.

So, it seems that as things stand, distutils can only build extensions
compatible with the standard python 2.4 distribution, using Visual
Studio .NET 2003, or with mingw (using my patch).

I'm reluctant to try fixing distutils to accept the .NET SDK compiler,
as I can't verify that any changes I make won't break VS.NET 2003
compatibility (as I don't have that compiler).

I hope this is of some use.

Paul.
-- 
A little inaccuracy sometimes saves tons of explanation -- Saki



More information about the Python-list mailing list