dmd64 on Windows: how?

Ivan Kazmenko gassa at mail.ru
Sun Aug 12 13:54:40 UTC 2018


On Sunday, 12 August 2018 at 03:49:04 UTC, Mike Parker wrote:
> On Saturday, 11 August 2018 at 19:50:30 UTC, Ivan Kazmenko 
> wrote:
>> I've installed the components shown in wiki image: v141 tools 
>> and the SDKs.
>
> VS 2017 Community includes everything you need. There's no 
> reason to install the SDK separately. If it's installed first, 
> the DMD installer will find it. The latest version will install 
> the MinGW system libs and the lld linker if no VS installation 
> is found. And for the past few versions, when you run dmd it 
> will look for the VS installation as needed. So it should work 
> out of the box without the need for the separate SDK or mucking 
> about with the paths in sc.ini.
>
> Is your VS 2017 the Community edition?

Yeah, I have VS 2017 Community Edition, and I was struggling 
trying to make 64-bit linking work, both with .7z archive and 
with .exe installer.

The .exe installer dmd-2.081.1.exe I've just tried again.
With default settings, it just installs into C:\D\ .
Its sc.ini is almost empty, no sign of Visual Studio environment 
variables or paths.

Then I run cmd.exe:

~~~~~
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\D>dmd2vars64.bat

Setting up 64-bit environment for using DMD 2 from 
C:\D\dmd2\windows\bin.

dmd must still be called with -m64 in order to generate 64-bit 
code.
This command prompt adds the path of extra 64-bit DLLs so 
generated programs
which use the extra DLLs (notably libcurl) can be executed.

C:\D>echo void main () {} > a.d

C:\D>dmd -m64 a.d
C:\D\dmd2\windows\bin\lld-link.exe: error: could not open 
libcmt.lib: no such fi
le or directory
Error: linker exited with status 1
~~~~~

My Windows version is Windows Server 2008 R2.
Microsoft Visual Studio Community 2017, version 15.7.6.
At C:\Program Files (x86), there are:
Microsoft Visual Studio            [ 2754M ]
Microsoft Visual Studio 12.0       [   50M ]
Microsoft Visual Studio 14.0       [  954M ]
The latter two contain some remains of the previous 
installations, so that may be the issue with detecting the 
current Visual Studio version.

Ivan Kazmenko.



More information about the Digitalmars-d-learn mailing list