Bug 21604 – LINK : fatal error LNK1104: cannot open file 'libucrt.lib'

Status
NEW
Severity
normal
Priority
P3
Component
installer
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2021-02-02T00:38:17Z
Last change time
2025-01-02T15:47:24Z
Assigned to
No Owner
Creator
Adam D. Ruppe
Moved to GitHub: installer#665 →

Comments

Comment #0 by destructionator — 2021-02-02T00:38:17Z
A user on discord was trying D for the first time and hit the libucrt file missing problem with dub (and -m32mscoff, -m64, but not with dmd -m32). They hinted that they came from WinForms which gave me a theory: they had Visual Studio installed for .net, but not the native SDK. They got the Win 10 native SDK from Microsoft and it solved the problem. I haven't proven this, but I suspect the problem came because the dmd installed looked for Visual Studio, found it, then tried to use its lib directory. However, since the VS install only had the C#/.net components, the library was missing. With a fresh install, we should be able to reproduce and test that problem. The installer could also just try to build a hello world to self-test after installing and if it gets that error, also install the win 10 native sdk: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/ Or at least direct the user to do that themselves. OR it could scan Visual Studio and see that the native libs are missing and instead of trying to use it just use the built-in lld-link or whatever. I don't know if that would work. Anyway my system is in no state to do a clean test to reproduce the problem, and this user's problem is now solved, but I wanna put this up here to get fixed in the future.
Comment #1 by robert.schadek — 2025-01-02T15:47:24Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/installer/issues/665 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB