/Qspectre option causes “LNK1104 cannot open file ‘MSVCRTD.lib‘“ error in VS2017

Intro

This page records two ways to fix the  "LNK1104 cannot open file 'MSVCRTD.lib'" with Spectre in VS2017.

The Spectre mitigation for VS2017

https://aka.ms/Ofhn4c

Warning	MSB8038	Spectre mitigation is enabled but Spectre mitigated libraries are not found.  Verify that the Visual Studio Workload includes the Spectre mitigated libraries.  See https://aka.ms/Ofhn4c for more information.	WindowsProject1	C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets	402	

Problem

  1. On fresh Windows 10. Install Visual Studio 2017 version 15.8.9.
  2. Create new "Visutal C++ \ Windows Desktop Application" project with wizard.
  3. Compile the project will get below link error:
1>LINK : fatal error LNK1104: cannot open file 
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
当在使用 Visual Studio 编译项目时出现 "link: fatal error lnk1104: cannot open file 'OpenSSL::crypto.lib'" 错误时,通常是因为无法找到 OpenSSL 库文件。 要解决这个问题,首先应该确保已经正确安装了 OpenSSL 库,并且能够在系统上找到它。 1. 确保 OpenSSL 已正确安装:检查系统上是否已经正确安装了 OpenSSL。可以在 OpenSSL 的官方网站上下载适合您系统的安装程序,并根据安装向导进行安装。 2. 配置 Visual Studio 项目:打开 Visual Studio,并进入您的项目的属性设置。在属性窗口的左侧导航栏中选择 “链接器” > “输入”,然后在右侧的 “附加依赖项” 中添加 OpenSSL 库的名称。通常情况下,您应该添加 "libcrypto.lib" 和 "libssl.lib"。 3. 配置库文件路径:在属性窗口中,仍然在 “链接器” > “常规” 部分,将 OpenSSL 库文件的路径添加到 “附加库目录” 中。这个路径应该是 OpenSSL 库文件(.lib)所在的文件夹路径。 4. 点击 “确定” 保存更改,并重新编译项目:确保您保存了项目的更改,并尝试重新编译项目。如果您的 OpenSSL 库文件路径和名称正确配置,并且已正确安装 OpenSSL,那么应该不再出现 "lnk1104" 错误。如果仍然出现此错误,请再次检查您的配置设置。 希望这些步骤能够帮助您解决 "link: fatal error lnk1104: cannot open file 'openssl::crypto.lib'" 错误。如果问题仍然存在,您可能需要进一步检查您的 OpenSSL 安装和配置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值