Visual Studio 2010 error C2065: '_In_opt_z_' : undeclared identifier 编译错误

当用Visual Studio 2010 编译时 发生如下编译错误:

2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(550): error C2065: '_In_opt_z_' : undeclared identifier
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(550): error C2143: syntax error : missing ')' before 'const'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(550): warning C4229: anachronism used : modifiers on data are ignored
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(550): error C2182: '_invoke_watson' : illegal use of type 'void'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(550): error C2495: '_invoke_watson' : '__declspec(noreturn)' can only be applied to function declarations or definitions
。。。

。。。
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(96): error C2144: syntax error : 'int' should be preceded by ')'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(96): error C2448: 'isupper' : function-style initializer appears to be a function definition
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(96): error C2059: syntax error : ')'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(97): error C2144: syntax error : 'int' should be preceded by ';'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(97): error C2065: '_In_' : undeclared identifier
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(97): error C2144: syntax error : 'int' should be preceded by ')'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(97): error C2448: '_isupper_l' : function-style initializer appears to be a function definition
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(97): error C2146: syntax error : missing ';' before identifier '_locale_t'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(97): error C2059: syntax error : ')'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(98): error C2144: syntax error : 'int' should be preceded by ';'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(98): error C2065: '_In_' : undeclared identifier
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(98): error C2144: syntax error : 'int' should be preceded by ')'
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(98): error C2448: 'islower' : function-style initializer appears to be a function definition
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(98): error C2059: syntax error : ')'

。。。

这是由于WDK中的sal.h文件和Visual Studio中的sal.h文件冲突了。

由于Visual Studio 2010中的sal.h文件比较新,因此产生了这个错误。

解决方法:

1.删除WDK中的sal.h

2.重命名WDK中的sal.h

3.把Visual Studio 2010中的sal.h copy到WDK目录中 覆盖WDK的sal.h

WDK sal.h的位置在:C:\WinDDK\7600.16385.0\inc\api\sal.h

4. 将C:\Program Files\Microsoft Visual Studio 10.0\VC\include;
放在它C:\WinDDK\7600.16385.1\inc\api前面,即可

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值