Clarifications on compiling for Windows

Martin v. Loewis martin at v.loewis.de
Sat Jan 9 05:24:40 EST 2010


> First of all, is the Windows FAQ fairly up to date?

Fairly, yes.

> Should people be
> referring to section 6 if they are going to build an application with
> an embedded Python interpreter?

I think that's very selective in its view of problems - why would I
be using SWIG, for example? (yet there are three issues dedicated to
SWIG in this section)

pythonNN.dll is not in \windows\system, but in system32 or winsxs.

pythonNN.lib is *not* a static library, but (as the text then notes)
an import library. So even if you link with pythonNN.lib, you *still*
need pythonNN.dll at run-time (what is discussed as a drawback of
dynamic linking). Of course, it might be possible to build a static
library out of Python (which then still might be called pythonNN.lib).

IMO, it should be possible to link Python into the executable (at
the expense of not supporting dynamic loading of extension modules
anymore).

> If I understand correctly, compiled extensions for Python on Windows
> should match the compiler that was used to build the interpreter
> itself? Is there a list somewhere that shows which version of msvc was
> used to compile the recent Python binaries?

See PCbuild/readme.txt of the respective Python release.

2.3:      VC 6
2.4, 2.5: VC 7.1 / VS .NET 2003
2.6, 3.1: VC 9 / VS 2008

Regards,
Martin



More information about the Python-list mailing list