DMD-2.065.0-b3 and VisualD x64 select optlink as linker
Rainer Schuetze
r.sagitario at gmx.de
Mon Feb 10 23:07:26 PST 2014
On 10.02.2014 23:59, Arjan wrote:
> On Monday, 10 February 2014 at 19:01:49 UTC, Rainer Schuetze wrote:
>>
>>
>> On 10.02.2014 14:56, Arjan wrote:
>>> I Installed the dmd-2.065.0-b3.exe on Window-7 (64bits) with VS2008
>>> (64bits) professional and VS2010Express(32bits) installed.
>> Check the settings on the page given above. If everything seems ok,
>> please post the buildlog or the *.build.cmd file in the output directory.
>
> Checked the settings in "Projects and Solutions->Visual D settings->DMD
> directories->x64":
> checked "override linker settings from dmd configuration in sc.ini"
> linker: $(VCINSTALLDIR)\bin\link.exe
>
> => Failed to link:
> *.build.cmd
> ------------------8<---------------------
> set PATH=C:\usr\local\d\x64\bin;C:\Program Files\Microsoft
> SDKs\Windows\v6.0A\\bin;%PATH%
> set DMD_LIB=c:\Program Files (x86)\Microsoft Visual Studio
> 9.0\VC\\lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\x64
> set WindowsSdkDir=C:\Program Files\Microsoft SDKs\Windows\v6.0A\
> set VCINSTALLDIR=c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\
> dmd -m64 -g -debug -X -Xf"Debug DMD x64\TestX64.json" -deps="Debug DMD
> x64\TestX64.dep" -c -of"Debug DMD x64\TestX64.obj" main.d
> if errorlevel 1 goto reportError
>
> set LIB=
> echo. > C:\usr\local\src\play\TestX64\TestX64\DEBUGD~1\TESTX6~1.LNK
> echo "Debug DMD x64\TestX64.obj" /OUT:"Debug DMD x64\TestX64.exe"
> /MAP:"Debug DMD x64\TestX64.map" user32.lib kernel32.lib
> /LIBPATH:"c:\Program Files (x86)\Microsoft Visual Studio
> 9.0\VC\\lib\amd64\" /LIBPATH:C:\Program\ /LIBPATH:Files\Microsoft\
> /LIBPATH:SDKs\Windows\v6.0A\lib\x64\ /DEBUG /INCREMENTAL:NO /NOLOGO >>
> C:\usr\local\src\play\TestX64\TestX64\DEBUGD~1\TESTX6~1.LNK
>
> "C:\Program Files (x86)\VisualD\pipedmd.exe" link.exe
> @C:\usr\local\src\play\TestX64\TestX64\DEBUGD~1\TESTX6~1.LNK
> if errorlevel 1 goto reportError
> if not exist "Debug DMD x64\TestX64.exe" (echo "Debug DMD
> x64\TestX64.exe" not created! && goto reportError)
>
> goto noError
>
> :reportError
> echo Building Debug DMD x64\TestX64.exe failed!
>
> :noError
> --------------------->8--------------------------
>
> remarks:
> set PATH=C:\usr\local\d\x64\bin; <== wrong path!
What is wrong about it? I guess it is the path that you have set
manually in the "Executable paths" option.
> echo "Debug DMD.... <== messes up the /LIBPATH: !
>
Spaces in path names are often causing headaches, but I don't see how
this causes troubles here.
>
> buildlog:
> ---------------------8<--------------------------
> Build Log
> Building Debug DMD x64\TestX64.exe
> Command Line
> set PATH=C:\usr\local\d\x64\bin;C:\Program Files\Microsoft
> SDKs\Windows\v6.0A\\bin;%PATH%
> set DMD_LIB=c:\Program Files (x86)\Microsoft Visual Studio
> 9.0\VC\\lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\x64
> set WindowsSdkDir=C:\Program Files\Microsoft SDKs\Windows\v6.0A\
> set VCINSTALLDIR=c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\
> dmd -m64 -g -debug -X -Xf"Debug DMD x64\TestX64.json" -deps="Debug DMD
> x64\TestX64.dep" -c -of"Debug DMD x64\TestX64.obj" main.d
> if errorlevel 1 goto reportError
>
> set LIB=
> echo. > C:\usr\local\src\play\TestX64\TestX64\DEBUGD~1\TESTX6~1.LNK
> echo "Debug DMD x64\TestX64.obj" /OUT:"Debug DMD x64\TestX64.exe"
> /MAP:"Debug DMD x64\TestX64.map" user32.lib kernel32.lib
> /LIBPATH:"c:\Program Files (x86)\Microsoft Visual Studio
> 9.0\VC\\lib\amd64\" /LIBPATH:C:\Program\ /LIBPATH:Files\Microsoft\
> /LIBPATH:SDKs\Windows\v6.0A\lib\x64\ /DEBUG /INCREMENTAL:NO /NOLOGO >>
> C:\usr\local\src\play\TestX64\TestX64\DEBUGD~1\TESTX6~1.LNK
>
> "C:\Program Files (x86)\VisualD\pipedmd.exe" link.exe
> @C:\usr\local\src\play\TestX64\TestX64\DEBUGD~1\TESTX6~1.LNK
> if errorlevel 1 goto reportError
> if not exist "Debug DMD x64\TestX64.exe" (echo "Debug DMD
> x64\TestX64.exe" not created! && goto reportError)
>
> goto noError
>
> :reportError
> echo Building Debug DMD x64\TestX64.exe failed!
>
> :noError
> Output
> OPTLINK (R) for Win32 Release 8.00.15
> Copyright (C) Digital Mars 1989-2013 All rights reserved.
> http://www.digitalmars.com/ctg/optlink.html
> OPTLINK : Warning 9: Unknown Option : OUT
> OPTLINK : Error 12: Number Overflow :
> Building Debug DMD x64\TestX64.exe failed!
> --------------------->8--------------------------
>
> remarks:
> The "pipedmd.exe" command uses the link.exe found first in the search path.
This seems to be the main issue: there does not seem to be a link.exe at
$(VCINSTALLDIR)\bin\link.exe, so it falls back to using PATH to let the
system search for it, and this then grabs optlink. What would be a
correct path for your installation?
Another issue is that you have probably specified the Windows SDK Lib
path without quotes, so it is split into several paths due to spaces in
the path names. Unfortunately, it isn't always even clear to me when
path separation works on line splits, spaces or semicolon, so better use
quoting.
>
>
> When I disabled the "override linker ...." the build and link succeeds!
>
This falls back to using the settings in sc.ini, which is usually ok,
but might cause trouble when working with a different version of VS than
assumed by the installer.
Rainer
More information about the Digitalmars-d-ide
mailing list