当用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前面,即可

Visual Studio 2010 error C2065: '_In_opt_z_' : undeclared identifier 编译错误的更多相关文章

  1. error C2065: 'assert' : undeclared identifier

    F:\VC6.0 : error C2065: 'assert' : undeclared identifier 导入#include <assert.h>

  2. error C2065: ‘_bstr_t’ : undeclared identifier

    转自VC错误:http://www.vcerror.com/?p=828 问题描述: error C2065: '_bstr_t' : undeclared identifier 解决方法: 详细的解 ...

  3. error C2065: ‘__in’ : undeclared identifier

    转自VC错误:http://www.vcerror.com/?p=1307 问题描述: 编译时出现: error C2065: '__in' : undeclared identifier error ...

  4. error C2065: CoInitializeEx' : undeclared identifier 解决方法

    错误: error C2065: CoInitializeEx' : undeclared identifier 解决方法 原因: 本来程序的编译选项选择的是:使用标准windows库,当改为在静态库 ...

  5. error C2065: 'CArchiveStream' : undeclared identifier

    release:模式下 问题: 在导入JPEG文件时要使用到  CArchiveStream类  但是编译的时候会出现  'CArchiveStream'   :   undeclared   ide ...

  6. visual studio 2010 Error: IntelliSense: identifier "DWORD" is undefined

    在自己工程里,添加别的工程文件时,出现改错误 解决方法 在文件前添加: using namespace std; 参考: http://www.programgo.com/article/502412 ...

  7. error C2065: 'INVALID_SET_FILE_POINTER' : undeclared identifier

    Searching MSDN for that constant brings up one result: it's a failure code for SetFilePointer() and ...

  8. error C2065: 'IDD_DIALOG1' : undeclared identifier

    添加资源文件 #include "resource.h"

  9. VS2008编译错误:error C2065: 'PMIB_TCPSTATS' : undeclared identifier c:\program files (x86)\microsoft sdks\windows\v7.0a\include\iphlpapi.h 411

    安装了VS2008编译之前的程序,结果出现了编译错误,以为是VS2008的Sp1补丁没装好,重装补丁后还是不行,编译错误如下: 双击错误会定位在iphlpapi.h中, 一个可行的解决办法是:把iph ...

随机推荐

  1. Vuejs input 和 textarea 元素中使用 v-model 实现双向数据绑定

    demo <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <titl ...

  2. jQuery实现enter键登录

    在登录时,使用快捷键登录时常用的方法,其中 loginReq()方法为请求登录检索的方法 $("#login").click(function(){ loginReq(); }); ...

  3. 原生js如何获取某一元素的高度

    三种方法: 1.document.getElementById("id").style.height,这种方法的前提是必须之前已经显示的在css中声明过height,才能取得正确的 ...

  4. Linux下可以运行bat文件么?

    bat是批处理文件,在windows和linux上都可以使用. 不过在linux的命令行中不可以直接敲"xxx.bat",系统会去找所有的命令. 想要调用bat文件,需要写绝对路径 ...

  5. thinkphp环境要求

    框架本身没有什么特别模块要求,具体的应用系统运行环境要求视开发所涉及的模块.ThinkPHP底层运行的内存消耗极低,而本身的文件大小也是轻量级的,因此不会出现空间和内存占用的瓶颈. PHP版本要求 P ...

  6. 在DELPHI中显示GIF动画

    想没想过在DELPHI中显示GIF动画?Delphi的用户是非常幸运的,因为有免费控件可以使用.最著名的控件是Anders Melander编写的TGifImage,并提供完整的源程序.它原来的主页是 ...

  7. VS卸载不干净,再次安装盘符不能更改问题(转载)

    下载文件,直接用. 链接:https://pan.baidu.com/s/1K1cbJUq_JC9DN2MoE6Z3RA 密码:cuad

  8. C++从string中删除所有的某个特定字符【转载】

    转载自https://www.cnblogs.com/7z7chn/p/6341453.html C++中要从string中删除所有某个特定字符, 可用如下代码 str.erase(std::remo ...

  9. KiFastCallEntry() 机制分析

    1. 概述 从 windows xp 和 windows 2003 开始使用了快速切入内核的方式提供系统服务例程的调用. KiFastCallEntry() 的实现是直接使用汇编语言,C 语言不能直接 ...

  10. VScode中写vue代码 Ctrl+/添加注释失效

    1.点击列表的文件——>首选项——>键盘快捷方式,在里面查看 Ctrl+/ 是否有冲突 2.查看右下角的选择语言模式是否是Vue,如下图