VC++ 2008下C2106和C3457 错误

今天在VC++2008下重新编译了以下CGNS库,出现了一系列奇怪的错误:

...

1>c:\program files\microsoft visual studio 9.0\vc\include\float.h(88) : error C2106: “=”: 左操作数必须为左值
1>c:\program files\microsoft visual studio 9.0\vc\include\float.h(88) : error C3457: “vc_attributes::Pre”: 属性不支持未命名参数
1>c:\program files\microsoft visual studio 9.0\vc\include\float.h(88) : error C2106: “=”: 左操作数必须为左值
1>c:\program files\microsoft visual studio 9.0\vc\include\float.h(88) : error C3457: “vc_attributes::Pre”: 属性不支持未命名参数
1>c:\program files\microsoft visual studio 9.0\vc\include\float.h(90) : error C2106: “=”: 左操作数必须为左值
1>c:\program files\microsoft visual studio 9.0\vc\include\float.h(90) : error C3457: “vc_attributes::Pre”: 属性不支持未命名参数
1>c:\program files\microsoft visual studio 9.0\vc\include\float.h(90) : error C2106: “=”: 左操作数必须为左值

...

在VC++2005下一点错误都没有,真是奇怪。

网上相关内容非常少,不过还是找到了答案,原来都是Null惹地祸,在VC++2008中,SAL.h中已经定义了Null,此时如果在自己程序中重复定义,就会出现上述错误。解决办法就是把Null定义去掉或改成其它名称,详细介绍参考:http://support.microsoft.com/kb/953977

 

 

posted on 2009-06-25 18:02  codezhang  阅读(1290)  评论(3编辑  收藏  举报

导航