error A2070: invalid instruction operands

zlib 在 Visual Studio 2005 下编译失败的解决办法(转)

                                      

 

最近需要读写 png 文件,按照以前的办法试验,却发现无法编译zlib 1.2.3。出错信息为:

inffas32.asm(594) : error A2070: invalid instruction operands
inffas32.asm(596) : error A2070: invalid instruction operands
inffas32.asm(610) : error A2070: invalid instruction operands
inffas32.asm(667) : error A2070: invalid instruction operands

上网一查,发现别人也遇到相同的问题:http://svn.haxx.se/dev/archive-2005-11/0942.shtml。原因在于

It (Microsoft Macro Assembler 8.0, included with Visual C++ 2005 Express ) refuses to assemble a MOVD instruction with a memory operand with an implied size, and requires that "dword ptr" prefix the memory operand.

微软说这是by design,不是bug:

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=6306f7dc-2cc2-4591-bd60-5d802178fdfa

解决办法是把inffas32.asm中的4处出错的类似

 movd mm4, [esp+0]

的汇编代码,添加dword ptr修饰符,改为

 movd mm4,dword ptr [esp+0]

这样就能顺利编译、通过测试了。 

当然,其它的error A2070: invalid instruction operands错误也做同样处理。

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值