Thread overview
msvc linker error: can't find kernel32.lib
Nov 20, 2014
Dustin
Nov 20, 2014
Rainer Schuetze
Nov 21, 2014
Dustin
November 20, 2014
I compiled ldc on Windows 7 following the instructions in the wiki, no issues there. I can compile D programs just fine with no linker errors only if I launch a visual studio 64 bit developer command prompt. However I want to use visualD to compile my programs. Visual studio doesn't even set the environment variables for the linker because I get the same "missing kernel32.lib" error. I tried reading vcvars64.bat, which is called when I launch the developer command prompt, to understand how the environment is set up, but I got totally lost trying to read it. Any suggestions on how I can permenantly set up my environment so visual studio's linker is happy?
November 20, 2014
On 20.11.2014 15:29, Dustin wrote:
> I compiled ldc on Windows 7 following the instructions in the wiki, no
> issues there. I can compile D programs just fine with no linker errors
> only if I launch a visual studio 64 bit developer command prompt.
> However I want to use visualD to compile my programs. Visual studio
> doesn't even set the environment variables for the linker because I get
> the same "missing kernel32.lib" error. I tried reading vcvars64.bat,
> which is called when I launch the developer command prompt, to
> understand how the environment is set up, but I got totally lost trying
> to read it. Any suggestions on how I can permenantly set up my
> environment so visual studio's linker is happy?

I guess you must add something like

$(VCInstallDir)\lib\amd64
$(WindowsSdkDir)Lib\winv6.3\um\x64

to "Tools->Options->Projects and Solutions->Visual D Settings->LDC Directories->x64->Library paths".

Especially the Windows SDK folder might be different for your installed SDK.
November 21, 2014
I figured it out, just needed to give the linker a few import paths. Thanks!