VS2013 with LDC setup

Ronnie via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sat May 30 09:29:54 PDT 2015


Hi

Has anyone got a full build and debugging environment working 
with LDC 0.15.2 and VS2013 for 64bit?

For this test program using DMD compiler in VisualD it all works 
fine. I can compile,link, and debug.

import std.stdio;

int main(string[] argv)
{
     writeln("Hello D-World!");
     return 0;
}

If I set the compiler to LDC I have to start by running 
vsvars64.bat first then devenv.exe for it to pick up the correct 
link.exe (rather than optilink), and I've added C:\Program 
Files\Microsoft SDKs\Windows\v7.1\Lib\x64;H:\Apps\Visual 
Studio\VC\lib\amd64\ to the "Library Search Path" to ensure it 
picks up kernel32.lib and LIBCMTD.lib

That got rid of a lot of errors so far, but it's still failing at 
the last step

Here's buildlog.html output if anyone can help. It seems to be 
related to the linking somehow. Any help appreciated.

(Separately, can dub work with ldc2 on windows? - I'll ask on a 
separate thread since it's also giving errors)


set LIB=;H:\Apps\D\ldc2\lib;C:\Program Files\Microsoft 
SDKs\Windows\v7.1\Lib\x64;H:\Apps\Visual Studio\VC\lib\amd64\
set WindowsSdkDir=C:\Program Files (x86)\Windows Kits\8.1\
set VCINSTALLDIR=H:\Apps\Visual Studio\VC\
"H:\apps\VisualD\pipedmd.exe" H:\Apps\D\ldc2\bin\ldc2.exe -m64 -g 
-X -Xf="Debug\ConsoleApp1.json" -deps="Debug\ConsoleApp1.dep" 
-of="Debug\ConsoleApp1.exe_cv" -L/MAP:"Debug\ConsoleApp1.map" 
main.d
if errorlevel 1 goto reportError
if not exist "Debug\ConsoleApp1.exe_cv" (echo 
"Debug\ConsoleApp1.exe_cv" not created! && goto reportError)
echo Converting debug information...
"H:\apps\VisualD\cv2pdb\cv2pdb.exe" "Debug\ConsoleApp1.exe_cv" 
"Debug\ConsoleApp1.exe"
if errorlevel 1 goto reportError
if not exist "Debug\ConsoleApp1.exe" (echo 
"Debug\ConsoleApp1.exe" not created! && goto reportError)

goto noError

:reportError
echo Building Debug\ConsoleApp1.exe failed!

:noError
Output
ConsoleApp1.obj : error LNK2017: 'ADDR32' relocation to 
'.debug_info' invalid without /LARGEADDRESSAWARE:NO
ConsoleApp1.obj : error LNK2017: 'ADDR32' relocation to 
'.debug_info' invalid without /LARGEADDRESSAWARE:NO
ConsoleApp1.obj : error LNK2017: 'ADDR32' relocation to 
'.debug_info' invalid without /LARGEADDRESSAWARE:NO
ConsoleApp1.obj : error LNK2017: 'ADDR32' relocation to 
'.debug_info' invalid without /LARGEADDRESSAWARE:NO
druntime-ldc-debug.lib(errno.c.obj) : warning LNK4099: PDB 
'vc120.pdb' was not found with 
'druntime-ldc-debug.lib(errno.c.obj)' or at 
'H:\Users\Mushfaque.Cradle\documents\D\ConsoleApp1\ConsoleApp1\Debug\vc120.pdb'; 
linking object as if no debug info
druntime-ldc-debug.lib(msvc.c.obj) : warning LNK4099: PDB 
'vc120.pdb' was not found with 
'druntime-ldc-debug.lib(msvc.c.obj)' or at 
'H:\Users\Mushfaque.Cradle\documents\D\ConsoleApp1\ConsoleApp1\Debug\vc120.pdb'; 
linking object as if no debug info
LINK : fatal error LNK1165: link failed because of fixup errors
Error: H:\Apps\Visual Studio\VC\BIN\amd64\link.exe failed with 
status: 1165
Building Debug\ConsoleApp1.exe failed!


More information about the digitalmars-d-ldc mailing list