Python本身用VC2003编译的.我手头没有,只能用VC++6.0了.
环境: VC++6.0,WinXP SP3,PSDK2003
1.用VC6编译了Python后,覆盖原来的Python环境.
2.设置环境变量:WXWIN,WXDIR = D:\D\CPP\wxWidgets
3.将%WXDIR%\include\wx\msw里将setup0.h复制成setup.h,并修改setup.h
修改变量的值 :
wxUSE_DEBUGREPORT 0
wxUSE_EXCEPTIONS 0
wxUSE_DIALUP_MANAGER 0
wxUSE_GRAPHICS_CONTEXT 1
wxUSE_GLCANVAS 1
wxUSE_POSTSCRIPT 1
wxUSE_DIB_FOR_BITMAP 1
原文档介绍的wxUSE_DATEPICKCTRL_GENERIC没有修改,修改后编译wxPython会出错.
4.运行 SDK中的 Set Windows XP 32-bit Build Environment (Retail),进入WXDIR目录.
运行nmake -f makefile.vc OFFICIAL_BUILD=1 SHARED=1 MONOLITHIC=0 USE_OPENGL=1 USE_GDIPLUS=1 DEBUG_FLAG=1 CXXFLAGS=/D__NO_VC_CRTDBG__ WXDEBUGFLAG=h BUILD=release UNICODE=1
编译wxWidgets
5. 修改%WXDIR%\wxPython\config.py , 将"/GX-"前面的注释去掉.否则VC6编译出错.
运行 setup.py build_ext --inplace MONOLITHIC=0 UNICODE=1 FINAL=1 BUILD_STC=0 BUILD_GLCANVAS=0 BUILD_GIZMOS=0
编译wxPython
6.测试 set PYTHONPATH=%WXDIR%\wxPython
cd %WXDIR%\wxPython\demo
demo.py
7.打包环境.
xcopy %wxdir%\lib\vc_dll\*.dll %wxdir%\dist\wx\*.*
xcopy %wxdir%\wxPython\wx\*.* %wxdir%\dist\wx\*.* /E /H
xcopy %wxdir%\wxPython\wxPython\*.* %wxdir%\dist\wxPython\*.* /E /H