compiler-errors - 在Windows 10上构建OBS-Studio时发生编译时错误

标签 compiler-errors windows-10 visual-studio-2019 cmake-gui obs-studio

我正在尝试按照以下官方步骤来构建obs-studio:
https://github.com/obsproject/obs-studio/wiki/Install-Instructions#windows-build-directions
我使用cmake GUI生成Visual Studio项目。当我尝试在Visual Studio中构建项目时,出现这些错误

Severity    Code    Description Project File    Line    Suppression State
Error   C2039   'IsCursorCaptureEnabled': is not a member of 'winrt::Windows::Graphics::Capture::GraphicsCaptureSession'    libobs-winrt    C:\Users\alokm\obs-studio\libobs-winrt\winrt-capture.cpp    290 

Error   C2039   'IsCursorCaptureEnabled': is not a member of 'winrt::Windows::Graphics::Capture::GraphicsCaptureSession'    libobs-winrt    C:\Users\alokm\obs-studio\libobs-winrt\winrt-capture.cpp    372 

Error   C2039   'IsCursorCaptureEnabled': is not a member of 'winrt::Windows::Graphics::Capture::GraphicsCaptureSession'    libobs-winrt    C:\Users\alokm\obs-studio\libobs-winrt\winrt-capture.cpp    473 
我该如何解决这些错误?
这是我的Visual Studio详细信息
Microsoft Visual Studio Community 2019
Version 16.8.4
VisualStudio.16.Release/16.8.4+30907.101
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

Visual C++ 2019   00435-60000-00000-AA868
Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019   16.8.557.25636
ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0   16.8.557.25636
Azure App Service Tools v3.0.0

C# Tools   3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

NuGet Package Manager   5.8.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

Visual Basic Tools   3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Linux Development   1.0.9.30608
Visual C++ for Linux Development

Visual F# Tools   16.8.0-beta.20507.4+da6be68280c89131cdba2045525b80890401defd
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

最佳答案

更新Windows SDK并删除过时的版本可以解决所有错误。
在Visual Studio中打开Tools> Get Tools and Features> Individual components使用“Windows SDK”搜索,然后选择最新的Windows 10 SDK并取消选择旧版本,然后单击modify
enter image description here

关于compiler-errors - 在Windows 10上构建OBS-Studio时发生编译时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65718410/

相关文章:

c++ - 为什么 clang 不允许派生类调用 protected 基函数?

java - 从派生类调用构造函数

c++ - 在 Windows 中读取/写入各种音频文件元数据

c++ - npm 安装 : fatal error C1083 on bson and kerberos compilation 上的 node-gyp 错误

visual-studio-2013 - Windows 10 上的 Visual Studio 2013 SDK

c++ - 使用 Visual Studio 为 C++ wxwidgets 项目生成可部署二进制文件时遇到问题

templates - VS2019 + Xamarin.Forms = UWP/EXE 被删除?

c++ - 出现多重定义错误

c# - 错误 : IEnumerable could Not be defined in non-generic static class

visual-studio - 运行时出现 Visual Studio 2019 异常(来自 HRESULT : 0x80070490) 的异常