www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - Cannot build HelloWorld in VisualD with VS2017

reply Domain <dont_email empty.com> writes:
Default console application template.

Detail log:

Command Line

set PATH=C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86;C:\Program
Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE;C:\Program
Files (x86)\Windows Kits\8.1\bin\x86;.\windows\bin;%PATH%
dmd -g -debug -X -Xf"Win32\Debug\hellod.json" 
-deps="Win32\Debug\hellod.dep" -c -of"Win32\Debug\hellod.obj" 
main.d
if errorlevel 1 goto reportError

set LIB=
echo. > 
C:\Users\Main\DOCUME~1\VIBB41~1\Projects\hellod\hellod\Win32\Debug\HELLOD~1.LNK
echo 
"Win32\Debug\hellod.obj","Win32\Debug\hellod.exe","Win32\Debug\hel
od.map",user32.lib+ >>
C:\Users\Main\DOCUME~1\VIBB41~1\Projects\hellod\hellod\Win32\Debug\HELLOD~1.LNK
echo kernel32.lib/NOMAP/CO/NOI/DELEXE >> 
C:\Users\Main\DOCUME~1\VIBB41~1\Projects\hellod\hellod\Win32\Debug\HELLOD~1.LNK

"C:\Program Files (x86)\VisualD\pipedmd.exe" -deps 
Win32\Debug\hellod.lnkdep link.exe 
 C:\Users\Main\DOCUME~1\VIBB41~1\Projects\hellod\hellod\Win32\Debug\HELLOD~1.LNK
if errorlevel 1 goto reportError
if not exist "Win32\Debug\hellod.exe" (echo 
"Win32\Debug\hellod.exe" not created! && goto reportError)

goto noError

:reportError
echo Building Win32\Debug\hellod.exe failed!

:noError

Output

Microsoft (R) Incremental Linker Version 14.10.25017.0
Copyright (C) Microsoft Corporation.  All rights reserved.

"Win32\Debug\hellod.obj,Win32\Debug\hellod.exe,Win32\Debug\hellod.map,user32.lib+"
kernel32.lib/NOMAP/CO/NOI/DELEXE
LINK : fatal error LNK1181: 
无法打开输入文件“Win32\Debug\hellod.obj,Win32\Debug\hellod.exe,Win32\Debug\hellod.map,user32.lib+”
Building Win32\Debug\hellod.exe failed!


The Chinese means "Cannot open input files"
Mar 22 2017
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 22.03.2017 09:33, Domain wrote:
 Default console application template.

 Detail log:

 Command Line

 set PATH=C:\Program Files (x86)\Microsoft Visual
 Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86;C:\Program
 Files (x86)\Microsoft Visual
 Studio\2017\Enterprise\Common7\IDE;C:\Program Files (x86)\Windows
 Kits\8.1\bin\x86;.\windows\bin;%PATH%
 dmd -g -debug -X -Xf"Win32\Debug\hellod.json"
 -deps="Win32\Debug\hellod.dep" -c -of"Win32\Debug\hellod.obj" main.d
 if errorlevel 1 goto reportError

 set LIB=
 echo. >
 C:\Users\Main\DOCUME~1\VIBB41~1\Projects\hellod\hellod\Win32\Debug\HELLOD~1.LNK

 echo
 "Win32\Debug\hellod.obj","Win32\Debug\hellod.exe","Win32\Debug\hellod.map",user32.lib+

C:\Users\Main\DOCUME~1\VIBB41~1\Projects\hellod\hellod\Win32\Debug\HELLOD~1.LNK echo kernel32.lib/NOMAP/CO/NOI/DELEXE >> C:\Users\Main\DOCUME~1\VIBB41~1\Projects\hellod\hellod\Win32\Debug\HELLOD~1.LNK "C:\Program Files (x86)\VisualD\pipedmd.exe" -deps Win32\Debug\hellod.lnkdep link.exe C:\Users\Main\DOCUME~1\VIBB41~1\Projects\hellod\hellod\Win32\Debug\HELLOD~1.LNK if errorlevel 1 goto reportError if not exist "Win32\Debug\hellod.exe" (echo "Win32\Debug\hellod.exe" not created! && goto reportError) goto noError :reportError echo Building Win32\Debug\hellod.exe failed! :noError Output Microsoft (R) Incremental Linker Version 14.10.25017.0 Copyright (C) Microsoft Corporation. All rights reserved. "Win32\Debug\hellod.obj,Win32\Debug\hellod.exe,Win32\Debug\hellod.map,user32.lib+" kernel32.lib/NOMAP/CO/NOI/DELEXE LINK : fatal error LNK1181: 无法打开输入文件“Win32\Debug \hellod.obj,Win32\Debug\hellod.exe,Win32\Debug\hellod.map,user32.lib+” Building Win32\Debug\hellod.exe failed! The Chinese means "Cannot open input files"
The problem is that the wrong link.exe is called. This happens because the dmd bin folder is not correct in the PATH environment variable: it lists ".\windows\bin", but the dmd installation folder is missing. It's probably missing on the Tools->Options->Projects and Solutions->Visual D Settings->DMD directories page. You might also have to move the respective entry of the executable search paths before the VS2017 paths.
Mar 22 2017
parent Domain <dont_email empty.com> writes:
On Wednesday, 22 March 2017 at 21:04:30 UTC, Rainer Schuetze 
wrote:
 The problem is that the wrong link.exe is called. This happens 
 because the dmd bin folder is not correct in the PATH 
 environment variable: it lists ".\windows\bin", but the dmd 
 installation folder is missing. It's probably missing on the 
 Tools->Options->Projects and Solutions->Visual D Settings->DMD 
 directories page. You might also have to move the respective 
 entry of the executable search paths before the VS2017 paths.
Great! Setting DMD directories fix the problem. Thanks!
Mar 22 2017