Compiling Python C/C++ extensions with Visual Studio .NET 2005

lordross | Work, devel | Friday, September 29th, 2006

Here I will write a simple HOWTO compile your C/C++ extensions for Python with M$ VS .NET2005

1. Download and extract Python source tarball somewhere.

2. There is a \PCBuild8 folder. Open the pcbuild solution.

3. According to README in the same folder compile first pythoncore, python and other projects. They should compile with no problems.
4. Copy your binaries somewhere. ( optional, but you should use this binary in step 6 ).

5. To make distutils user your setup.py you will need to open the VS .NET Command Line utils and set the following envars.

set DISTUTILS_USE_SDK=1
set MSSDK=1

This will make the distutil tools not to search in the registry for VS .NET 2003 and its paths. It will just find the tools via the $PATH variable.

6. python setyp.py build according to your setup :)

Powered by OpenBSD, WordPress and APC UPS