问题描述
我是Windows开发领域的新手.我的计算机上安装了Visual Studio 2010和Windows SDK 7.0a.任何win32应用程序(甚至是使用向导生成的框架)都会使我多次重复出现此编译错误:
I am new to windows development world. I am having Visual Studio 2010 and windows SDK 7.0a installed on my machine. Any win32 application (even the skeleton generated using the wizard) is giving me this compilation error repeated hundreds of times:
2>注意:包括文件:C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ include \ stdio.h
2>注意:包括文件:C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ include \ crtdefs.h
2>注意:包括文件:C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ include \ swprintf.inl
2>注意:包括文件:C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ Windows.h
2>注意:包括文件:C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ sdkddkver.h
2>注意:包括文件:C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ include \ excpt.h
2>注意:包括文件:C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ include \ crtdefs.h
2>注意:包括文件:C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ include \ stdarg.h
2>注意:包括文件:C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ windef.h
2>注意:包括文件:C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ winnt.h
2>注意:包括文件:C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ include \ ctype.h
2>注意:包括文件:C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ include \ crtdefs.h
2>注意:包括文件:C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ specstrings.h
* 2>注意:包括文件:c:\ program files \ microsoft sdks \ windows \ v7.0a \ include \ sal_supp.h *
* 2>注意:包括文件:c:\ program files \ microsoft sdks \ windows \ v7.0a \ include \ specstrings_supp.h *
* 2>注意:包括文件:C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ specstrings_strict.h *
* 2>注意:包括文件:C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ specstrings_undef.h *
2>注意:包括文件:C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ driverspecs.h
* 2>注意:包括文件:c:\ program files \ microsoft sdks \ windows \ v7.0a \ include \ sdv_driverspecs.h *
2> C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ driverspecs.h(356):错误C3861:'SAL_functionClass':找不到标识符
2> C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ driverspecs.h(356):错误C2059:语法错误:')'
2> C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ driverspecs.h(374):错误C2144:语法错误:'char'前面应带有')'
2> C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ driverspecs.h(374):错误C3861:'SAL_acquire':找不到标识符
2> Note: including file: C:\Program Files\Microsoft Visual Studio 10.0\VC\include\stdio.h
2> Note: including file: C:\Program Files\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
2> Note: including file: C:\Program Files\Microsoft Visual Studio 10.0\VC\include\swprintf.inl
2> Note: including file: C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\Windows.h
2> Note: including file: C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\sdkddkver.h
2> Note: including file: C:\Program Files\Microsoft Visual Studio 10.0\VC\include\excpt.h
2> Note: including file: C:\Program Files\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
2> Note: including file: C:\Program Files\Microsoft Visual Studio 10.0\VC\include\stdarg.h
2> Note: including file: C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\windef.h
2> Note: including file: C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winnt.h
2> Note: including file: C:\Program Files\Microsoft Visual Studio 10.0\VC\include\ctype.h
2> Note: including file: C:\Program Files\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
2> Note: including file: C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\specstrings.h
*2> Note: including file: c:\program files\microsoft sdks\windows\v7.0a\include\sal_supp.h*
*2> Note: including file: c:\program files\microsoft sdks\windows\v7.0a\include\specstrings_supp.h*
*2> Note: including file: C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\specstrings_strict.h*
*2> Note: including file: C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\specstrings_undef.h*
2> Note: including file: C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h
*2> Note: including file: c:\program files\microsoft sdks\windows\v7.0a\include\sdv_driverspecs.h*
2>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h(356): error C3861: 'SAL_functionClass': identifier not found
2>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h(356): error C2059: syntax error : ')'
2>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h(374): error C2144: syntax error : 'char' should be preceded by ')'
2>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h(374): error C3861: 'SAL_acquire': identifier not found
请告知.谢谢.
推荐答案
看看您的VS包含路径.如果您安装了更多SDKS(即Windows 7.1或其他),则该订单可能已经搞砸了.或者,也许您修改了路径以添加一些自己的路径.
Take a look at your VS include paths. If you installed more SDKS (ie, Windows 7.1 or others) then the order may have gotten screwed up. Or perhaps you modified the paths to add some of your own.
转到项目"->属性"->配置属性"->"VC ++目录"->包含目录".我的看起来像这样:
Go to Project->Properties->Configuration Properties->VC++ Directories->Include Directories. Mine looks like this:
包含目录= $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;
我建议使它们看起来像默认值,并查看是否仍然存在问题.如果库目录在编译后未链接,则可能必须修复.我的看起来像这样:
I'd suggest making them look like the default and seeing if you still have the problem. You may have to fix your Library Directories if it doesn't link after it compiles. Mine looks like this:
图书馆目录= $(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib
这篇关于Visual Studio 2010和Windows SDK 7.0a编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!