[Distutils] Problem compiling Extensions on Win32

Thomas Heller theller at python.net
Wed Feb 4 13:56:55 EST 2004

"G D" <garth at utmail.to> writes:

> This is proably a dumb noobie question, but hopefully some of you have
> seen this type of thing before.
> I'm trying to compile a set of Extensions for a Zope app, I'm using
> the Python that came with Zope2.7RC2 which is Py 2.3.3 on a Windows
> system.
> After setting the system path to include the Zope bin and bin\include
> directories (where the Python.exe and the header files live), I
> attempt to compile the extensions by doing the following.
> python setup.py build -cmingw32 
> I get a hole bunch of undefined interface type errors (the computer's
> at home so I'm going by memory) similar to __Inf__PyString undefined,
> and it ends off with a line about WinMain at 16 with that setup
> terminates.

I know near to nothing about mingw, so I have no suggestion here.

> When I try the same thing with MSVC7 (from the .NET 1.1 SDK), I get an
> error message that Python was compiled with Visual C 6 and modules
> must be compiled with that compiler.

which is correct...

> The seemingly odd thing to me is when I try it with MSVC6 Std Ed
> (starting a new cmd prompt and loading the VC6 .bat file for
> environment), I get the same error message - which doesn't make sense.

We just had this issue - distutils doesn't pick up the usual environment
variables.  It only reads from the registry.  Look into the sources for
distutils/msvccompiler.py.  On my machine, the directories are in the
registry as values of the key

HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Build System\Components\Platforms\Win32 (x86)\Directories

Is this key present on your machine, and has it 'Include Dirs', 'Library
Dirs', and 'Path Dirs' values?


More information about the Distutils-SIG mailing list