www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21604] New: LINK : fatal error LNK1104: cannot open file


          Issue ID: 21604
           Summary: LINK : fatal error LNK1104: cannot open file
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: installer
          Assignee: nobody puremagic.com
          Reporter: destructionator gmail.com

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.


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:


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.

Feb 01 2021