无法打开源文件"windows.h" "WTypes.h"

cannot open source file "windows.h" "WTypes.h"

本文关键字:windows WTypes 源文件 开源      更新时间:2023-10-16

你好,谢谢你的帮助。我最近下载了一些c++的源文件。他们建立了一个管理摄像机的DLL。无论如何,当打开Visual Studio 2015时,它通知我将有一些转换,因为编译器已经更改。之后在

下面有红线
#include <windows.h>
#include <WType.h>

将鼠标移到它们上面,它显示"不能打开源代码文件…"

现在,我在谷歌上搜索了这个错误,发现了一些资源,甚至在这个网站上。然而,他们的解决方案并不奏效。有时候,OP只是说"哦,它起作用了,谢谢!",但并没有具体说明是什么使它起作用。

所以我在这里寻求一些帮助。这个错误是什么,我该如何解决它?(我猜它涉及到项目中的一些设置)

再次感谢您的帮助

(注。我有作者提供的dll,但想自己构建项目)

编辑:构建时输出消息为

    1>------ Build started: Project: DirectShowFacade, Configuration: Debug Win32 ------
1>C:Program FilesMSBuildMicrosoft.Cppv4.0V140PlatformsWin32PlatformToolsetsv140_xpToolset.targets(36,5): warning MSB8003: Could not find WindowsSdkDir_71A variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
1>C:Program FilesMSBuildMicrosoft.Cppv4.0V140Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
1>  DirectShowFacade.cpp
1>d:xxxxxxxxxxxxxxxxcameraprogrammingdirectshowfacadesourcesdirectshowfacade.h(28): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

属性→通用→目标平台版本→8.1