3

I'm working on a project that build externals, when building the project a link error is raised : LNK1104 cannot open file "library.lib".

I have VS 2017 15.9.4, when i see the documentation /Qspectre documentation, they said that when i have the LNK1104 error is that i must install those libraries:

-MSVC version

-Visual C++ ATL with Spectre Mitigations

-Visual C++ MFC with Spectre Mitigations

I did that but it display the same error!

Someone faced the same problem please?

  • Check here: [How to add a Library to VS Project](https://stackoverflow.com/questions/4445418/how-to-add-additional-libraries-to-visual-studio-project) – Amit G. Jun 12 '19 at 13:19
  • 1
    Thank you @AmitG. but the project compiles in other machines without adding libraries to the project, i guess it's a VS config problem! – Saliha M'rad Jun 13 '19 at 11:55
  • This solved my problem https://www.ultraengine.com/community/topic/19040-c-build-lnk1104-file-libcpmtdlib-cannot-be-opened/?do=findComment&comment=118732 – M.R.T May 20 '21 at 09:04

1 Answers1

0

I post this solution for others who will faced the same problem, The problem is that the WDK for Windows 10, version 1709 (after cleaning my machine) with the VS 15.9.4 to upper.

if you install the "WDK for Windows 10, version 1803" the Spectre will be enabled by default. Whet you can do in this case is to create a "Directory.Build.props" and add this code inside (this file must be added in the project directory):

<Project>
  <PropertyGroup Label="Configuration">
    <SpectreMitigation>false</SpectreMitigation>
  </PropertyGroup>
</Project>

Hope it will help you,