question

OhadLeshets-7461 avatar image
0 Votes"
OhadLeshets-7461 asked ·

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

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-wdk-general
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CymonKilmer-4330 avatar image
0 Votes"
CymonKilmer-4330 answered ·

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?

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OhadLeshets-7461 avatar image
0 Votes"
OhadLeshets-7461 answered ·

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

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CymonKilmer-4330 avatar image
0 Votes"
CymonKilmer-4330 answered ·

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)

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OhadLeshets-7461 avatar image
0 Votes"
OhadLeshets-7461 answered ·

Hello @CymonKilmer-4330 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

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OhadLeshets-7461 avatar image
0 Votes"
OhadLeshets-7461 answered ·

Hello @CymonKilmer-4330 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

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OhadLeshets-7461 avatar image
0 Votes"
OhadLeshets-7461 answered ·

Hi @CymonKilmer-4330

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

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TobiAfolayan-0954 avatar image
0 Votes"
TobiAfolayan-0954 answered ·

@OhadLeshets-7461 Firstly, I suggest that you reinstall Visual Studio and follow instructions from here - https://docs.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)

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

User863-8187 avatar image
2 Votes"
User863-8187 answered ·

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.

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Spectre-mitigated libs (Latest) was the key, thanks !

0 Votes 0 ·