D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21867 - DMD fails to link after installing Visual Studio 2019
Summary: DMD fails to link after installing Visual Studio 2019
Status: RESOLVED DUPLICATE of issue 19760
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Windows
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-27 08:32 UTC by Juraj
Modified: 2022-12-27 17:09 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Juraj 2021-04-27 08:32:54 UTC
DMD fails to link after installing Visual Studio 2019 Community (installing only .NET components).

To clarify, I used dmd without VS before and I had no issue.

To reproduce on my machine I just need to create empty folder c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC

lld-link: error: could not open 'libcmt.lib': no such file or directory
Error: linker exited with status 1

Removing the folder fixes the issue.

LDC does not have this problem and it links fine.

dmd --version
DMD64 D Compiler v2.096.1-dirty

Output of dmd -v:

With the folder (linking fails with above error)
c:\D\dmd2\windows\bin64\lld-link.exe /NOLOGO "app.obj" /OUT:"app.exe"  /DEFAULTLIB:phobos64 /DEBUG  /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\lib\amd64" /LIBPATH:"C:\D\dmd2\windows\bin\..\lib64\mingw"

And without (links fine)
c:\D\dmd2\windows\bin64\lld-link.exe /NOLOGO "app.obj" /OUT:"app.exe"  /DEFAULTLIB:phobos64 /DEBUG  /LIBPATH:"c:\D\dmd2\windows\bin64\..\lib64\mingw"
Comment 1 Iain Buclaw 2022-12-27 17:09:14 UTC

*** This issue has been marked as a duplicate of issue 19760 ***