Illegal Filename after basic install and trying Hello World

Gilbert Fernandes gilbert.fernandes at orange.fr
Wed Jun 26 13:57:22 UTC 2019


I am using VS 2019 into which I have C# and C++ active.
Installed the following : DMD 2.086.1 then Visual D 0.50.0
DMD has been installed at the base of C:\ at C:\D

Created a D project, which contains a default Hello world program.
Build fails. Running the program fails.

VS displays the following error :

------ Build started: Project: Test2, Configuration: Debug x64 
------
Building x64\Debug\Test2.exe...
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Error 8: Illegal Filename
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped 
==========

Besides installing Visual D and creating a new project, done 
nothing.

I have searched the forum for people with the same problem and 
found two threads.
https://forum.dlang.org/post/poq048$28mm$1@digitalmars.com
https://forum.dlang.org/post/xmhkgkqujxmzruquecfw@forum.dlang.org

None do help. The option "override linker settings from sc.ini" 
is nowhere it seems. I have checked both inside the current 
project properties, and VS settings themselves.

I have the following cmd to build the program in the folder :

set PATH=C:\Program Files (x86)\Visual Studio\VC\bin;C:\Program 
Files (x86)\Visual Studio\Common7\IDE;C:\Program Files 
(x86)\Windows Kits\10\bin;C:\D\dmd2\windows\bin;%PATH%
set DMD_LIB=C:\Program Files (x86)\Visual Studio\VC\lib\amd64
set VCINSTALLDIR=C:\Program Files (x86)\Visual Studio\VC\
set VCTOOLSINSTALLDIR=C:\Program Files (x86)\Visual 
Studio\VC\Tools\MSVC\14.21.27702\
set VSINSTALLDIR=C:\Program Files (x86)\Visual Studio\
set WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
set WindowsSdkVersion=10.0.17763.0
set UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
set UCRTVersion=10.0.17763.0
"C:\Program Files (x86)\VisualD\pipedmd.exe" -deps 
x64\Debug\Test2.dep dmd -m64 -g -gf -debug -X 
-Xf"x64\Debug\Test2.json" -c -of"x64\Debug\Test2.obj" Test2.d
if %errorlevel% neq 0 goto reportError

set LIB=C:\D\dmd2\windows\bin\..\lib64
echo. > D:\sources_D\Test2\Test2\x64\Debug\Test2.link.rsp
echo "x64\Debug\Test2.obj" /OUT:"x64\Debug\Test2.exe" user32.lib  
 >> D:\sources_D\Test2\Test2\x64\Debug\Test2.link.rsp
echo kernel32.lib  >> 
D:\sources_D\Test2\Test2\x64\Debug\Test2.link.rsp
echo legacy_stdio_definitions.lib /LIBPATH:"C:\Program Files 
(x86)\Visual Studio\VC\lib\amd64" /DEBUG 
/PDB:"x64\Debug\Test2.pdb" /INCREMENTAL:NO /NOLOGO /noopttls 
/NODEFAULTLIB:libcmt libcmtd.lib /SUBSYSTEM:CONSOLE >> 
D:\sources_D\Test2\Test2\x64\Debug\Test2.link.rsp
"C:\Program Files (x86)\VisualD\mb2utf16.exe" 
D:\sources_D\Test2\Test2\x64\Debug\Test2.link.rsp

"C:\Program Files (x86)\VisualD\pipedmd.exe" -msmode -deps 
x64\Debug\Test2.lnkdep C:\D\dmd2\windows\bin\link.exe 
@D:\sources_D\Test2\Test2\x64\Debug\Test2.link.rsp
if %errorlevel% neq 0 goto reportError
if not exist "x64\Debug\Test2.exe" (echo "x64\Debug\Test2.exe" 
not created! && goto reportError)

goto noError

:reportError
echo Building x64\Debug\Test2.exe failed!

:noError

Typing "link" seems to launch the D Optilink Linker by default on 
my CMD.
If I understand properly, I should be using the VS C++ supplied 
linker ?

Inside VS settings I have the following in the DMD Directories :

Win32 Executable Paths :
$(VCINSTALLDIR)bin
$(VSINSTALLDIR)Common7\IDE
$(WindowsSdkDir)bin
$(DMDInstallDir)windows\bin

x64 has the same ones, but a library path defined :
$(VCINSTALLDIR)lib\amd64

And the following linker is defined :
C:\D\dmd2\windows\bin\link.exe

I don't know how to fix this.

Should this work after a basic Visual D install or there are some 
configurations steps I missed ?



More information about the Digitalmars-d-learn mailing list