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

15,842

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).

Share:
15,842
Anonymous-User
Author by

Anonymous-User

Updated on June 04, 2022

Comments

  • Anonymous-User
    Anonymous-User almost 2 years

    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?

  • Aster Veigas
    Aster Veigas almost 3 years
    This helped me solve the issue. Thanks @Jesper Juhl