pydasm安装

环境:winXP,python2.7

网上下载的libasm_1.5

参照这位兄台的做法:http://www.adintr.com/article/blog/263

由于没装VS,所以C的编译很是问题。google了下,有说用MingW即可。

安装完MingW之后,将bin设置到环境变量的path中,基本上准备工作是完成了。为了方便,在%Python27%\Lib\distutils下建了个distutils.cfg,作用是方便在build的时候不用写  --compiler = mingw32

[build]
compiler = mingw32

但是在编译pydasm的时候,还是出现了一点问题,提示 “cc1.exe: 错误:unrecognized command line option ‘-mno-cygwin’”,不识别编译选项

D:\Program Files\Python27\Lib\site-packages\libdasm-1.5\pydasm>setup.py install
running install
running build
running build_ext
building 'pydasm' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
D:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall "-ID:\Program Files\Python27\inc
lude" "-ID:\Program Files\Python27\include" "-ID:\Program Files\Python27\PC" -c
../libdasm.c -o build\temp.win32-2.7\Release\..\libdasm.o
cc1.exe: 错误:unrecognized command line option ‘-mno-cygwin’
error: command 'gcc' failed with exit status 1

费了九牛二虎之力,才找到办法,即修改 %Python27%\Lib\distutils 的cygwinccompiler.py文件,找到其中的‘-mno-cygwin’部分,删除之(简单一点查找替换即可),

参考:http://stackoverflow.com/questions/6034390/compiling-with-cython-and-mingw-produces-gcc-error-unrecognized-command-line-o

It sounds like GCC 4.7.0 has finally removed the deprecated -mno-cygwin option, 
but distutils has not yet caught up with it. Either install a slightly older version of MinGW, 
or edit distutils\cygwinccompiler.py in your Python directory to remove all instances of -mno-cygwin

直接install ,OK

D:\Program Files\Python27\Lib\site-packages\libdasm-1.5\pydasm>setup.py install
running install
running build
running build_ext
building 'pydasm' extension
D:\MinGW\bin\gcc.exe -mdll -O -Wall "-ID:\Program Files\Python27\include" "-ID:\
Program Files\Python27\include" "-ID:\Program Files\Python27\PC" -c ../libdasm.c
 -o build\temp.win32-2.7\Release\..\libdasm.o
D:\MinGW\bin\gcc.exe -mdll -O -Wall "-ID:\Program Files\Python27\include" "-ID:\
Program Files\Python27\include" "-ID:\Program Files\Python27\PC" -c pydasm.c -o
build\temp.win32-2.7\Release\pydasm.o
writing build\temp.win32-2.7\Release\..\pydasm.def
creating build\lib.win32-2.7
D:\MinGW\bin\gcc.exe -shared -s build\temp.win32-2.7\Release\..\libdasm.o build\
temp.win32-2.7\Release\pydasm.o build\temp.win32-2.7\Release\..\pydasm.def "-LD:
\Program Files\Python27\libs" "-LD:\Program Files\Python27\PCbuild" -lpython27 -
lmsvcr90 -o build\lib.win32-2.7\pydasm.pyd
running install_lib
copying build\lib.win32-2.7\pydasm.pyd -> D:\Program Files\Python27\Lib\site-pac
kages
running install_egg_info
Writing D:\Program Files\Python27\Lib\site-packages\pydasm-1.5-py2.7.egg-info


过几天再把pydbg装上

 

 

转载于:https://my.oschina.net/dkexcellent/blog/38717

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值