2009/03/31

how to get python25_d.lib and python25_d.dll

If do want to use "python25_d.lib" and/or "python25_d.dll" to debug python scripts,
can use Visual C++ to compile python25 source code.

1. download python-2.5.4.tgz (11M) from python's official website:
http://www.python.org/ftp/python/2.5.4/Python-2.5.4.tgz

2. Unzipped and look for directory "python-2.5.4\PCbuild8\"
(Note that: directory ".\PCbuild\" is for VC 7.0)

Use VC++ 2005 (ver8.0) to open the pcbuild.sln under directory ".\PCbuild8\". You will see 20 projects. Build only two projects "python" and "pythoncore".


3. There will be two files "python25_d.lib" and "python25_d.dll" generated under directory ".\PCbuild8\win32debug". Copy them into "c:\python25\libs" and "c:\windows\system32"
respectively. Previously, "python25.dll" and "python25.lib" already there.


4. Turn on "debug" in VC and rebuild. Succeed.

However, I did not figure out how to use debug version in VC to debug into my python file.:-(

Note: Python's latest version is 2.6. But since I use "pylab/matplotlib" which currently only offers package ver0.98 for python2.5 under windows. So,... python2.5.4 is my choice.

没有评论: