0

在 VS2019 中使用 WDK 时,出现此构建错误:

错误 MSB8040:此项目需要 Spectre-mitigated 库

VS2019 设置中有很多项目包含“幽灵”。

https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk#wdk-for-windows-10-version-1903说:

对于您打算为其构建驱动程序的每个架构,请通过单个组件 -> 编译器、构建工具和运行时 -> MSVC v142 - VS 2019 C+ x64/x86 Spectre 缓解库 (v14.21) 安装 Spectre 缓解库。

https://developercommunity.visualstudio.com/content/problem/746245/spectre-mitigated-libraries-are-required-for-this.html

我认为您需要安装以下组件: MSVC V142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.xx) C++ ATL,用于最新的 v142 构建工具和 Spectre-mitigations (x86 & x64) C++ MFC,用于最新的 v142 构建具有 Spectre-mitigations 的工具(x86 和 x64)

安装哪个?

4

1 回答 1

2

VS2019 工具集“WindowsKernelModeDriver10.0”(您需要选择它来构建驱动程序项目)似乎使用了 VS2019 支持的最高版本的 C++ 工具集。

目前最高版本是14.23所以只需要安装

MSVC v142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.23)
于 2019-11-12T04:11:50.647 回答