Compiling Python 2.5.1 from scratch using MS Visual Studio 2005
I usually use prepackaged binaries to install Python on Windows machines. Lately I have been trying to get back into using Intel’s open source vision library, OpenCV. To do that it appears I need to compile extension modules to be able to use Python, which in turn requires that I have the source and be able to build from it.
The build process has been relatively smooth, the MSVS 2005 solution file is located in the PCBuild8 directory. The biggest hiccup has been to get the sqlite3 extension module compiled, the instructions say I need to download the source distribution for sqlite3 from the svn.python.org SVN repository, but it has not been available today so far. Building sqlite3 from sources available at the sqlite site is a hassle, as it appears to require Mingw. I can of course do this, but I don’t have the time I used to.
A shortcut is to download the binary/DLL files from the sqlite website. This zip file contains both sqlite3.dll and the DEF file. However, the python solution requires a sqlite3.lib file, which is usually generated when one compiles and links the source files.
A little bit of googling led me to the def2lib.exe tool which converts DEF files to LIB files. The tool is located here.