1

在 Visual Studio 2017 RC 中构建 C++ 项目时,我不断收到错误消息。

1>------ Build started: Project: test, Configuration: Debug x64 ------
1>Source.cpp
1>LINK : fatal error LNK1104: cannot open file 'ucrtd.lib'
1>Done building project "test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

操作系统:Windows 8.1、Visual Studio 2017 候选版本

这是我的程序:

int main()
{
}

我没有将语言设置为任何特殊的

在此处输入图像描述

我在整个机器上搜索了该文件。但找不到。我已经安装了 Windows SDK 8.1

更新:@user1336087 发表评论后

我尝试安装 Windows SDK 10 我得到一个错误:

[14f0:0009][2016-11-23T09:22:20] Package 'Win10SDK_10.0.14393.33,version=10.0.14393.3300' failed to install. Command executed: "C:\ProgramData\Microsoft\VisualStudio\Packages\Win10SDK_10.0.14393.33,version=10.0.14393.3300\packages\Win10SDK\10.0.14393.33\sdksetup.exe" /features OptionId.WindowsSoftwareDevelopmentKit OptionId.WindowsSoftwareLogoToolkit OptionId.NetFxSoftwareDevelopmentKit /quiet /norestart, Return code: -2146889721, Details: The hash value is not correct.

这里似乎已经描述了一种解决方法:link 但即使我卸载所有 SDK 并重新安装,解决方法仍然失败。

4

2 回答 2

1

它适用于 Visual Studio 2017 的最终版本

于 2017-03-19T18:32:58.827 回答
0

此处的此评论帮助我解决了同样的错误。似乎存在旧版本的 Windows SDK 会导致 LINK 混淆。删除旧版本我已经解决了这个问题。

https://community.intel.com/t5/Intel-Fortran-Compiler/LINK-fatal-error-LNK1104-cannot-open-file-ucrtd-lib-with-VS2015/td-p/1060422

于 2020-11-18T01:42:42.310 回答