最近在搭建python的windows开发环境,准备以2.66版本,安装pydbg等。 网上有很多帖子,解决问题。但是下载完libdasm-1.5安装pydasm的时候出现了问题: C:\Python26\libdasm-1.5\pydasm>setup.py install running install running build running build_ext building 'pydasm' extension error: Unable to find vcvarsall.bat 查阅资料,发现是vc6.0版本太老,没有这个文件vcvarsall.bat,如何解决呢。 有两种办法: 1)安装mingw5.1.6 2)咱装高版本的vc 咱vc6.0用习惯了,没必要为了这个升级vc,干脆尝试安装mingw。ok开始。 我下载了mingw5.1.6这个版本,是个windows安装文件,安装,为了保证万无一失,建议全部安装,即全部勾选。 在windows系统的环境变量中添加: ;C:\MinGW\bin;C:\MinGW\mingw32\bin;C:\MinGW\libexec\gcc\mingw32\3.4.5 这样是为了,在其他目录下也可以使用gcc工具。 ok,再回到C:\Python26\libdasm-1.5\pydasm> 输入setup.py install build --compiler=mingw32编译。 成功了C:\Python26\libdasm-1.5\pydasm>setup.py install build --compiler=mingw32 running install running build running build_ext building 'pydasm' extension C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python26\include -IC:\Pytho n26\include -IC:\Python26\PC -c ../libdasm.c -o build\temp.win32-2.6\Release\..\ libdasm.o C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python26\include -IC:\Pytho n26\include -IC:\Python26\PC -c pydasm.c -o build\temp.win32-2.6\Release\pydasm. o pydasm.c: In function `fill_inst_structure': pydasm.c:306: warning: passing arg 3 of `PyString_AsStringAndSize' from incompat ible pointer type pydasm.c: In function `pydasm_get_instruction': pydasm.c:459: warning: passing arg 3 of `PyString_AsStringAndSize' from incompat ible pointer type writing build\temp.win32-2.6\Release\..\pydasm.def creating build\lib.win32-2.6 C:\MinGW\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.6\Release\..\libd asm.o build\temp.win32-2.6\Release\pydasm.o build\temp.win32-2.6\Release\..\pyda sm.def -LC:\Python26\libs -LC:\Python26\PCbuild -lpython26 -lmsvcr90 -o build\li b.win32-2.6\pydasm.pyd running install_lib copying build\lib.win32-2.6\pydasm.pyd -> C:\Python26\Lib\site-packages running install_egg_info Writing C:\Python26\Lib\site-packages\pydasm-1.5-py2.6.egg-info C:\Python26\libdasm-1.5\pydasm> 在ide下:>>> import pydasm >>> 成功 |
|
来自: herowuking > 《Cracker》