building python extensions with .net sdk compiler?

Grumman grumman at example.com
Sat Dec 11 13:09:08 EST 2004


David Fraser wrote:
> 
> So using MinGW seems like the better option ... is it working for Python 
> 2.4?

Yes it does. :)  I haven't tried it, but probably.

The problem with the toolkit is that mscvccompiler.py in distutils is 
expecting VisualStudio to be installed, not the toolkit. So when it goes 
to lookup paths to the installed tools, it doesn't find them.

All that's actually needed to make it work (After installing all 4 
required packages) is to add several strings to your registry. You'll 
probably have to add all the keys below \Software\Microsoft as well.

Under : 
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories

You need to add the strings:
"Include Dirs"(path to toolkit \include; path to platform sdk \include)
"Library Dirs"(path to toolkit \lib; path to platform sdk \lib)
"Path Dirs" (path to toolkit \bin; path to platform sdk \bin)

And it'll be happy.

Of course it'd be nice if msvccompiler.py just fell back to looking for 
the toolkit/sdk default dirs (or looked them up via environment vars, 
since the toolkit does include a vcvars32.bat that sets appropriate 
ones) if the VS lookup failed.





More information about the Python-list mailing list