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,553 questions
0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. Ohad Leshets 1 Reputation point
    2021-01-20T20:56:27.19+00:00

    Hello @Cymon Kilmer -MSFT and thanks for the replay.
    I just don't have the first one: C++/CLI support for v142 build tools (Latest).

    my full list of installed components is below:

    .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

    0 comments No comments

  2. Ohad Leshets 1 Reputation point
    2021-01-21T18:28:53.303+00:00

    Hi @Cymon Kilmer -MSFT

    Still get the error even after adding:

    C++/CLI support for v142 build tools(14.28-16.8)
    C++/CLI support for v142 build tools(Latest)
    Visual Studio SDK
    Windows 10 SDK(10.0.16299.0)
    Windows 10 SDK(10.0.17134.0)
    Windows 10 SDK(10.0.17763.0)

    and removing unnecessary items:

    MSVC v142 - VS 2019 C++ ....... (v14.26) (All the six)
    MSVC v142 - VS 2019 C++ ....... (v14.27) (All the six)

    Any idea?
    thanks,
    Ohad

    0 comments No comments

  3. Tobi Afolayan 1 Reputation point
    2021-01-21T21:34:44.447+00:00

    @Ohad Leshets Firstly, I suggest that you reinstall Visual Studio and follow instructions from here - https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk.

    In summary, all you really need during VS installation is to select "Desktop development with C++" workload. Expand Desktop development with C++ and locate the MSVC v142 - VS 2019 C++ x64/x86 build tools (V14.xx) - note where xx should be the highest version available. With this information (v14.xx), go to Individual components and search for v14.xx. This will return the tool sets for all architectures, including Spectre mitigated libs. Select the driver architecture you are developing for. For example, searching for v14.25 returns the following:

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

    0 comments No comments