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

你离开我真会死。 提交于 2021-01-27 12:56:28

问题


I have a problem that I cannot solve. My code:

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

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

My goal is to run this program without any problems. Error message:

  • error MSB8040: Spectre-mitigated libraries are required for this project. Install them from the Visual Studio installer (Individual components tab) for any toolsets and architectures being used. Learn more: https://aka.ms/Ofhn4c

    I added some libraries but the error still apears. Added toolsets:

  • C++ ATL for the latest build tools version 142 (ARM)

  • C++ ATL for the latest build tools version 142 (ARM64)
  • C++ ATL for the latest build tools version (x86 i x64)
  • C++ ATL for the latest build tools version 142 with countermeasures for the Specter vulnerability (ARM)
  • C++ ATL for the latest build tools version 142 with countermeasures for the Specter vulnerability (ARM64)
  • C++ for the latest build tools version 142 with countermeasures for the Specter vulnerability (x86 i x64)

Could someone guide me step by step how to solve it?


回答1:


This: 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 to take full advantage).



来源:https://stackoverflow.com/questions/59479631/error-msb8040-spectre-mitigated-libraries-are-required-for-this-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!