问题
When using WDK in VS2019, I get this build error:
Error MSB8040: Spectre-mitigated libraries are required for this project
There are a lot of items in VS2019 setup that contains "spectre".
This https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk#wdk-for-windows-10-version-1903 says:
For each architecture you intend to build drivers for, install the Spectre mitigated libraries thru Individual Components -> Compilers, build tools, and runtimes -> MSVC v142 - VS 2019 C+ x64/x86 Spectre-mitigated libs (v14.21).
This https://developercommunity.visualstudio.com/content/problem/746245/spectre-mitigated-libraries-are-required-for-this.html says
I think you need to install the following components: MSVC V142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.xx) C++ ATL for latest v142 build tools with Spectre-mitigations (x86 & x64) C++ MFC for latest v142 build tools with Spectre-mitigations (x86 & x64)
Which to install?
回答1:
VS2019 toolset "WindowsKernelModeDriver10.0" (which you need to select to build driver projects) seems to use the highest version of C++ toolset that VS2019 supports.
For now the highest version is 14.23 so only need to install
MSVC v142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.23)
来源:https://stackoverflow.com/questions/58811910/to-use-wdk-in-vs2019-which-spectre-mitigated-library-should-be-installed