Adding components does not solve the Error : Spectre-mitigated libraries are required for this project...

Ohad Leshets 1 Reputation point
2021-01-11T21:21:46.313+00:00

After adding many components and setting the Spectre-Mitigation: Enabled (/Qspectre) still get the error:
"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 have: MSVC v142 - vs 2019 C++ x64/x86 build tools (Latest)

Components added:

C++ ATL for latest v142 build tools with Spectre-mitigations (x86 & x64)
C++ MFC for latest v142 build tools with Spectre-mitigations (x86 & x64)

MSVC v142 - VS 2019 C++ ARM build tools (v14.28-16.8)
MSVC v142 - VS 2019 C++ ARM Spectre-mitigated libs (v14.28-16.8)
MSVC v142 - VS 2019 C++ ARM64 build tools (v14.28-16.8)
MSVC v142 - VS 2019 C++ ARM64 Spectre-mitigated libs (v14.28-16.8)
MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.28-16.8)
MSVC v142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.28-16.8)

C++ ATL for latest v142 build tools (ARM)
C++ ATL for latest v142 build tools (ARM64)
C++ ATL for latest v142 build tools (x86 & x64)
C++ ATL for latest v142 build tools with Spectre Mitigations (ARM)
C++ ATL for latest v142 build tools with Spectre Mitigations (ARM64)
C++ ATL for latest v142 build tools with Spectre Mitigations (x86 & x64)

C++ MFC for latest v142 build tools (ARM)
C++ MFC for latest v142 build tools (ARM64)
C++ MFC for latest v142 build tools (x86 & x64)
C++ MFC for latest v142 build tools with Spectre Mitigations (ARM)
C++ MFC for latest v142 build tools with Spectre Mitigations (ARM64)
C++ MFC for latest v142 build tools with Spectre Mitigations (x86 & x64)

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,524 questions
0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. User863 21 Reputation points
    2021-03-18T00:53:10+00:00

    What solve this error for me:

    1. Run the installer
    2. Сlick the "Modify" button
    3. Select the "Individual components" tab
    4. Type in the search box: Libs for Spectre
    5. Select: MSVC V142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (Latest) (Important: there should be the word "Latest" at the end)
    6. Сlick the "Modify" button in the lower right corner.
    4 people found this answer helpful.

  2. Cymon Kilmer -MSFT 801 Reputation points
    2021-01-14T12:33:32.29+00:00

    Using VS16.8.4 with the same components added I am able to build the KMDF Driver sample without any Spectre errors, could more information be provided to help further investigate this?
    Are you able to build the KMDF driver sample without errors?

    0 comments No comments

  3. Ohad Leshets 1 Reputation point
    2021-01-15T00:22:45.61+00:00

    Thanks @Cymon Kilmer -MSFT about the answer. Also with the KMDF driver sample I have this error.
    I'm using VS16.9.0.

    0 comments No comments

  4. Cymon Kilmer -MSFT 801 Reputation points
    2021-01-19T21:06:32.82+00:00

    Installing 16.9 I'm not able to repro this. I have listed what I have selected under individual components, can you double check what is installed.

    C++/CLI support for v142 build tools (Latest)
    MSVC v142 - VS2019 C++ ARM build tools (v14.28-16.8)
    MSVC v142 - VS2019 C++ ARM Spectre-mitigated libs (v14.28-16.8)
    MSVC v142 - VS2019 C++ ARM64 build tools (v14.28-16.8)
    MSVC v142 - VS2019 C++ ARM64 Spectre-mitigated libs (v14.28-16.8)
    MSVC v142 - VS2019 C++ x64/x86 build tools (Latest)
    MSVC v142 - VS2019 C++ x64/x86 build tools (v14.28-16.8)
    MSVC v142 - VS2019 C++ x64/x86 Spectre-mitigated libs (v14.28-16.8)

    C++ ATL for latest v142 build tools (ARM)
    C++ ATL for latest v142 build tools (ARM64)
    C++ ATL for latest v142 build tools (x86 & x64)
    C++ ATL for latest v142 build tools with Spectre Mitigations (ARM)
    C++ ATL for latest v142 build tools with Spectre Mitigations (ARM64)
    C++ ATL for latest v142 build tools with Spectre Mitigations (x86 & x64)

    C++ MFC for latest v142 build tools (ARM)
    C++ MFC for latest v142 build tools (ARM64)
    C++ MFC for latest v142 build tools (x86 & x64)
    C++ MFC for latest v142 build tools with Spectre Mitigations (ARM)
    C++ MFC for latest v142 build tools with Spectre Mitigations (ARM64)
    C++ MFC for latest v142 build tools with Spectre Mitigations (x86 & x64)

    C++ v14.28 (16.8) ATL for v142 build tools (ARM)
    C++ v14.28 (16.8) ATL for v142 build tools (ARM64)
    C++ v14.28 (16.8) ATL for v142 build tools (x86 &x64)
    C++ v14.28 (16.8) ATL for v142 build tools with Spectre Mitigations (ARM)
    C++ v14.28 (16.8) ATL for v142 build tools with Spectre Mitigations (ARM64)
    C++ v14.28 (16.8) ATL for v142 build tools with Spectre Mitigations (x86 &x64)

    C++ v14.28 (16.8) MFC for v142 build tools (ARM)
    C++ v14.28 (16.8) MFC for v142 build tools (ARM64)
    C++ v14.28 (16.8) MFC for v142 build tools (x86 &x64)
    C++ v14.28 (16.8) MFC for v142 build tools with Spectre Mitigations (ARM)
    C++ v14.28 (16.8) MFC for v142 build tools with Spectre Mitigations (ARM64)
    C++ v14.28 (16.8) MFC for v142 build tools with Spectre Mitigations (x86 &x64)

    0 comments No comments

  5. Ohad Leshets 1 Reputation point
    2021-01-20T20:51:29.887+00:00

    Hello @Cymon Kilmer -MSFT and thanks for the replay.

    I have all the list but 1:
    I don't have: C++/CLI support for v142 build tools (Latest).

    My full list is:

    .NET 5.0 Runtime
    .NET Core 2.1 Runtime(LTS)
    .NET Core 3.1 Runtime(LTS)
    .NET Framework 3.5 development tools
    .NET Framework 4 targeting pack
    .NET Framework 4.5 targeting pack
    .NET Framework 4.5.1 targeting pack
    .NET Framework 4.5.2 targeting pack
    .NET Framework 4.6 targeting pack
    .NET Framework 4.6.1 targeting pack
    .NET Framework 4.7.2 targeting pack
    .NET Framework 4.8 SDK
    .NET Native
    .NET SDK
    Advanced ASP.NET features
    ML.NET Model Builder(Preview)

    Azure Authoring Tools
    Azure Compute Emulator
    Azure libraries for .NET
    Azure Storage Emulator
    Azure WebJobs Tools
    Cloud Explorer
    CLR data types for SQL Server
    Connectivity and publishing tools
    Container development tools

    Data sources for SQL Server support
    IIS Express
    SQL ADAL runtime
    SQL Server Command Line Utilities
    SQL Server Data Tools
    SQL Server Express 2016 LocalDB
    SQL Server ODBC Driver
    Web Deploy

    Developer Analitics tools
    NuGet package manager
    Text Temmplate Transformation

    C# and Visual Basic Roslyn compilers
    C++ 2019 Redistributable Update
    C++ CMake tools for Windows
    MSBuils

    MSVC v142 - VS 2019 C++ ARM build tools (v14.26)
    MSVC v142 - VS 2019 C++ ARM build tools (v14.27)
    MSVC v142 - VS 2019 C++ ARM build tools (v14.28-16.8)

    MSVC v142 - VS 2019 C++ ARM Spectre-mitigated libs (v14.26)
    MSVC v142 - VS 2019 C++ ARM Spectre-mitigated libs (v14.27)
    MSVC v142 - VS 2019 C++ ARM Spectre-mitigated libs (v14.28-16.8)

    MSVC v142 - VS 2019 C++ ARM64 build tools (v14.26)
    MSVC v142 - VS 2019 C++ ARM64 build tools (v14.27)
    MSVC v142 - VS 2019 C++ ARM64 build tools (v14.28-16.8)

    MSVC v142 - VS 2019 C++ ARM64 Spectre-mitigated libs (v14.26)
    MSVC v142 - VS 2019 C++ ARM64 Spectre-mitigated libs (v14.27)
    MSVC v142 - VS 2019 C++ ARM64 Spectre-mitigated libs (v14.28-16.8)
    MSVC v142 - VS 2019 C++ x64/x86 build tools(Latest)

    MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.26)
    MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.27)
    MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.28-16.8)

    MSVC v142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.26)
    MSVC v142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.27)
    MSVC v142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.28-16.8)

    .NET profiling tools
    C++ AddressSanitizer (Experimental)
    C++ profiling tools
    JavaScript diagnostics
    Just-In-Time debugger
    Test Adapter for Boost.Test
    Test Adapter for Google Test

    ASP.NET and web development tools
    C# and Visual Basic
    C++ core features
    F# language support
    F# language support for web projects
    IntelliCode
    JavaScript and TypeScript language support
    Razor Language Services

    Graphics debugger and GPU profiler for DirectX
    Image and 3D model editors

    C++ ATL for latest v142 build tools (ARM)
    C++ ATL for latest v142 build tools (ARM64)
    C++ ATL for latest v142 build tools (x86 & x64)
    C++ ATL for latest v142 build tools with Spectre Mitigations (ARM)
    C++ ATL for latest v142 build tools with Spectre Mitigations (ARM64)
    C++ ATL for latest v142 build tools with Spectre Mitigations (x86 & x64)

    C++ MFC for latest v142 build tools (ARM)
    C++ MFC for latest v142 build tools (ARM64)
    C++ MFC for latest v142 build tools (x86 & x64)
    C++ MFC for latest v142 build tools with Spectre Mitigations (ARM)
    C++ MFC for latest v142 build tools with Spectre Mitigations (ARM64)
    C++ MFC for latest v142 build tools with Spectre Mitigations (x86 & x64)

    C++ v14.28 (16.8) ATL for v142 build tools(ARM)
    C++ v14.28 (16.8) ATL for v142 build tools(ARM64)
    C++ v14.28 (16.8) ATL for v142 build tools(x86 & x64)
    C++ v14.28 (16.8) ATL for v142 build tools with Spectra Mitigations(ARM)
    C++ v14.28 (16.8) ATL for v142 build tools with Spectra Mitigations(ARM64)
    C++ v14.28 (16.8) ATL for v142 build tools with Spectra Mitigations(x86 & x64)

    C++ v14.28 (16.8) MFC for v142 build tools(ARM)
    C++ v14.28 (16.8) MFC for v142 build tools(ARM64)
    C++ v14.28 (16.8) MFC for v142 build tools(x86 & x64)
    C++ v14.28 (16.8) MFC for v142 build tools with Spectra Mitigations(ARM)
    C++ v14.28 (16.8) MFC for v142 build tools with Spectra Mitigations(ARM64)
    C++ v14.28 (16.8) MFC for v142 build tools with Spectra Mitigations(x86 & x64)
    Entity Framework 6 tools
    TypeScript 4.0 SDK

    Windows 10 SDK(10.0.18362.0)
    Windows 10 SDK(10.0.19041.0)
    Windows Universal C Runtime

    Live Share
    Microsoft BI Shared Components for Visual Studio
    Microsoft Reporting Services Projects
    Windows DriverKit

    thanks,
    Ohad

    0 comments No comments