Thread overview
[Issue 17384] LDC x64 linker error in VS2017
May 08, 2017
kinke@gmx.net
May 09, 2017
Rainer Schuetze
Jun 10, 2017
kinke@gmx.net
Jul 15, 2017
Rainer Schuetze
Jul 15, 2017
kinke@gmx.net
May 08, 2017
https://issues.dlang.org/show_bug.cgi?id=17384

kinke@gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke@gmx.net

--- Comment #1 from kinke@gmx.net ---
The problem is with PATH. The mspdb* DLLs seem to be available for the 2 native linkers (x86 => x86, x64 => x64) only, so for 64-bit targets, it should be `...\bin\HostX64\x64` (the linker being able to use > 3 GB memory being a nice side effect). The WinSDK dir for PATH should most likely also be x64 instead of the current x86 one.

[By clearing VSINSTALLDIR, LDC takes care of setting up the environment and that's why it works (1.3 at least, 1.2 doesn't support VS 2017).]

--
May 09, 2017
https://issues.dlang.org/show_bug.cgi?id=17384

Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario@gmx.de

--- Comment #2 from Rainer Schuetze <r.sagitario@gmx.de> ---
kinke's right, the DLL is missing for the cross compilation x86 <-> x64. Visual D uses the x86 folders in case you are working on a 32-bit host OS.

There are two workarounds:
1. if you are on 64-bit OS, you can just replace the LDC x64 executable search
path
     $(VCTOOLSINSTALLDIR)bin\HostX86\x64
   with
     $(VCTOOLSINSTALLDIR)bin\HostX64\x64

2. add another folder to the LDC x64 executable search path:
   $(VSINSTALLDIR)Common7\IDE

Visual D doesn't use LDC's automatic detection because it doesn't allow using different versions of VS.

--
June 10, 2017
https://issues.dlang.org/show_bug.cgi?id=17384

--- Comment #3 from kinke@gmx.net ---
> Visual D doesn't use LDC's automatic detection because it doesn't allow using different versions of VS.

It is possible - via env variable `LDC_VSDIR`. For LDC 1.0.0 compatibility, it'd have to end with a backslash, e.g., `LDC_VSDIR=C:\Program Files (x86)\Microsoft Visual Studio 12.0\`.

--
July 15, 2017
https://issues.dlang.org/show_bug.cgi?id=17384

Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Rainer Schuetze <r.sagitario@gmx.de> ---
fix released in https://github.com/dlang/visuald/releases/tag/v0.45.0-rc1

--
July 15, 2017
https://issues.dlang.org/show_bug.cgi?id=17384

--- Comment #5 from kinke@gmx.net ---
Thanks Rainer!

--