错误 MSB8040:此项目需要 Spectre 缓解库

error MSB8040: Spectre-mitigated libraries are required for this project

我有一个我无法解决的问题。我的代码:

#include "ntddk.h"
#include <stdlib.h>

NTSTATUS DriverEntry(IN PDRIVER_OBJECT theDriverObject,
    IN PUNICODE_STRING theRegistryPath)
{
    DbgPrint("Hello World!");
    return STATUS_SUCCESS;
}

我的目标是运行这个程序没有任何问题。错误信息:

有人可以一步步指导我如何解决吗?

这:https://devblogs.microsoft.com/cppblog/spectre-mitigations-in-msvc and the /Qspectre compiler option, is probably, what you are looking for? (Note that you'd need to recompile all code, including libraries you use, with /Qspectre充分利用)。