installer icon indicating copy to clipboard operation
installer copied to clipboard

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

Open dlangBugzillaToGithub opened this issue 4 years ago • 0 comments

Adam D. Ruppe (@adamdruppe) reported this on 2021-02-02T00:38:17Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=21604

CC List

  • Ahmet Sait

Description

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.

dlangBugzillaToGithub avatar Feb 02 '21 00:02 dlangBugzillaToGithub