Bug 19624 – x64 Build paths for VS 2017 are wrong after installation. VCINSTALL is deeper
Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P1
Component
visuald
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2019-01-28T00:24:31Z
Last change time
2019-02-01T07:35:30Z
Assigned to
No Owner
Creator
Marc Bach
Comments
Comment #0 by marc.arnold.bach — 2019-01-28T00:24:31Z
Hi,
win32 is building fine but with 64 bit I have trouble libs/paths
$VCINSTALDIR does never ever contain a /bin/linker.exe in VS2017, the folder is much deeper and by the way I have no idea which treebranch to choose.
I tried:
C:\VisualStudio2017\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe
Even then I get:
LINK : fatal error LNK1104: cannot open file 'libucrtd.lib'
That file I found somewhere else and dropped it in the path of dmd... to find that another lib is missing... dropping that leads to a final disaster as it needs obviously 4 other files near by ... obviously not the way to go, without a deeper idea of the build chain,
While it turned out to be important AND undocumented that VS needs "Visual Studio extension development" extension I have the feeling that MSVC folder content was created only after "Desktop development with C++ " installation in VS => right? Should be in docu as well.
So something is broken and the installer is not able to get it right, while setting $ environment is done by MS in the dark.
I am lost
Marc
Details:
Build Log
Building Win32\Debug\TestDApp1.exe
Command Line
set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Users\IBM_ADMIN\Desktop\Soft\D\dmd2\windows\bin;%PATH%
set DMD_LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\lib;C:\Program Files (x86)\Windows Kits\10\lib\10.0.14393.0\um\x86
set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\
set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
set WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
set WindowsSdkVersion=10.0.14393.0
set UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
set UCRTVersion=10.0.14393.0
"C:\Program Files (x86)\VisualD\pipedmd.exe" -deps Win32\Debug\TestDApp1.dep dmd -m32mscoff -g -gf -debug -X -Xf"Win32\Debug\TestDApp1.json" -c -of"Win32\Debug\TestDApp1.obj" TestDApp1.d
if %errorlevel% neq 0 goto reportError
set LIB=C:\Users\IBM_ADMIN\Desktop\Soft\D\dmd2\windows\bin\..\lib32mscoff
echo. > C:\Users\IBM_ADMIN\Desktop\Moje\TestDApp1\TestDApp1\Win32\Debug\TestDApp1.link.rsp
echo "Win32\Debug\TestDApp1.obj" /OUT:"Win32\Debug\TestDApp1.exe" user32.lib >> C:\Users\IBM_ADMIN\Desktop\Moje\TestDApp1\TestDApp1\Win32\Debug\TestDApp1.link.rsp
echo kernel32.lib /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.14393.0\um\x86" /DEBUG /PDB:"Win32\Debug\TestDApp1.pdb" /INCREMENTAL:NO /NOLOGO /noopttls /NODEFAULTLIB:libcmt libcmtd.lib /SUBSYSTEM:CONSOLE >> C:\Users\IBM_ADMIN\Desktop\Moje\TestDApp1\TestDApp1\Win32\Debug\TestDApp1.link.rsp
"C:\Program Files (x86)\VisualD\mb2utf16.exe" C:\Users\IBM_ADMIN\Desktop\Moje\TestDApp1\TestDApp1\Win32\Debug\TestDApp1.link.rsp
"C:\Program Files (x86)\VisualD\pipedmd.exe" -msmode -deps Win32\Debug\TestDApp1.lnkdep "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\bin\link.exe" @C:\Users\IBM_ADMIN\Desktop\Moje\TestDApp1\TestDApp1\Win32\Debug\TestDApp1.link.rsp
if %errorlevel% neq 0 goto reportError
if not exist "Win32\Debug\TestDApp1.exe" (echo "Win32\Debug\TestDApp1.exe" not created! && goto reportError)
goto noError
:reportError
echo Building Win32\Debug\TestDApp1.exe failed!
:noError
Output
TRACKER : error TRK0005: Failed to locate: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\bin\link.exe". The system cannot find the file specified.
Comment #1 by r.sagitario — 2019-01-28T22:18:41Z
I suspect your installation without any workload caused the default paths to be wrong. Here are the usual settings for DMD/x64:
Executable paths:
$(VCTOOLSINSTALLDIR)bin\HostX86\x86
$(VSINSTALLDIR)Common7\IDE
$(WindowsSdkDir)bin
$(DMDInstallDir)windows\bin
Library paths:
$(VCTOOLSINSTALLDIR)lib\x64
$(UCRTSdkDir)Lib\$(UCRTVersion)\ucrt\x64
$(WindowsSdkDir)lib\$(WindowsSdkVersion)\um\x64
Linker:
$(VCTOOLSINSTALLDIR)bin\HostX86\x86\link.exe
>While it turned out to be important AND undocumented that VS needs
>"Visual Studio extension development" extension I have the feeling
> that MSVC folder content was created only after "Desktop development
> with C++ " installation in VS => right? Should be in docu as well.
The missing assembly probably comes with any other "workload" aswell as it is used by most project wizars. It's true that "C++ development" is expected so far, I wasn't aware that you could almost get something working without that.
Comment #2 by marc.arnold.bach — 2019-01-30T14:39:18Z
Ha! This is crazy cool!
Three aspects:
1) Problem solved!
2)Incredible fast support ... I feel like a premium customer :o)
3) I came for D only.. I am a Ruby/Java guy that's why I start from scratch with no visual studio, no C++.
If the installation requires secret knowhow or is assuming magic installed c++ settings it is difficult.
I would have abandoned visualD to early just because of docu... and that would have been a pity because I found no debugger like here in linux.
Comment #3 by r.sagitario — 2019-02-01T07:35:30Z
Good to hear it works. Yeah, the debugger is a major selling point of VS.
The documentation is easy to fall behind, it should better focus on the newer versions of VS. VS2019 is already around the corner, though. I'll give it an update before the next release.