How do you compile DMD on Windows?

MoonlightSentinel moonlightsentinel at disroot.org
Sat May 1 23:07:35 UTC 2021


On Saturday, 1 May 2021 at 22:44:34 UTC, Blatnik wrote:
> I wanna hack on the compiler, but I've spend 3 hours and I 
> can't get the damned thing to compile!

You probably need to update the VS paths to match your local 
installation, Microsoft apparently changed their directory layout 
a few years ago AFAICT.

I use the following patch for win64.mak in druntime/phobos:


```patch
diff --git a/win64.mak b/win64.mak
index 1b4a9208..6f37ba13 100644
--- a/win64.mak
+++ b/win64.mak
@@ -6,7 +6,7 @@ MODEL=64
  #VCDIR=\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.27.29110
  #SDKDIR=\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0
  # Visual Studio 2015 and before
-VCDIR=\Program Files (x86)\Microsoft Visual Studio 10.0\VC
+VCDIR=C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64
  SDKDIR=\Program Files (x86)\Microsoft SDKs\Windows\v7.0A

  DMD_DIR=..\dmd
@@ -19,9 +19,9 @@ 
DMD=$(DMD_DIR)\generated\$(OS)\$(BUILD)\$(MODEL)\dmd
  # Visual Studio 2015 and before
  BINDIR=$(VCDIR)\bin\amd64

-CC=$(BINDIR)\cl
-LD=$(BINDIR)\link
-AR=$(BINDIR)\lib
+CC=$(VCDIR)\cl
+LD=$(VCDIR)\link
+AR=$(VCDIR)\lib
  CP=cp

  DOCDIR=doc
```




More information about the Digitalmars-d-learn mailing list