Visual Studio 2010和Windows SDK 7.0a编译错误

时间:2012-06-12 15:57:44

标签: c++ visual-studio-2010 visual-studio winapi visual-c++

我是Windows开发世界的新手。我在我的机器上安装了Visual Studio 2010和Windows SDK 7.0a。任何win32应用程序(甚至使用向导生成的骨架)都会给我这个重复数百次的编译错误:


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&gt; C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ driverspecs.h(374):错误C2144:语法错误:'char'前面应加')' <登记/> 2&gt; C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ include \ driverspecs.h(374):错误C3861:'SAL_acquire':未找到标识符


请指教。感谢。

1 个答案:

答案 0 :(得分:4)

查看您的VS包含路径。如果您安装了更多SDKS(即Windows 7.1或其他版本),那么订单可能已经搞砸了。或者您可能修改了路径以添加自己的路径。

转到项目 - &gt;属性 - &gt;配置属性 - &gt; VC ++目录 - &gt;包含目录。我看起来像这样:

包含目录= $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;

我建议让它们看起来像默认值,看看你是否还有问题。如果库目录在编译后没有链接,则可能必须修复它们。我看起来像这样:

图书馆目录= $(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib