Visual D in Visual Studio 2013 on Win 8.1 with DMD x64 Linker Problem Solved

Rainer Schuetze r.sagitario at gmx.de
Sun Nov 17 23:45:27 PST 2013


Thanks for the report.

On 18.11.2013 00:41, Tyler Jensen wrote:
> Question and answer in one. I found the answer to my question not long
> after composing the question. Posted here for others who are on the
> bleeding OS edge as well.
>
> My environment:
>    Running Windows 8.1.
>    Visual Studio 2013 Premium installed.
>    Install Visual D with VisualD-v0.3.37.exe.
>
> Create new D console app DMD/GDC.
>
> Switch solution config to "Debug DMD|x64"
>
> Hit F6 to build and get the following:
>
> ------ Build started: Project: ConsoleApp1, Configuration: Debug DMD x64
> ------
> Building Debug DMD x64\ConsoleApp1.exe...
> LINK : fatal error LNK1181: cannot open input file 'user32.lib'
> Building Debug DMD x64\ConsoleApp1.exe failed!
> ------
>
> How to fix this? That is the question.
>
> Partial answer found in known issues page:
> http://rainers.github.io/visuald/visuald/KnownIssues.html
>

This is a bit out of date, it should not be necessary anymore with newer 
versions of Visual D.

> That fix did not work but it led to trying this change to sc.ini (only
> showing changed lines):
>
> ; environment for both 32/64 bit
> [Environment]
> LIB="%@P%\..\lib";\dm\lib;"C:\Program Files (x86)\Windows
> Kits\8.0\Lib\win8\um\x86";%DMD_LIB%
> ; original LIB="%@P%\..\lib"
>
> [Environment32]
> ; original LIB="%@P%\..\lib"
> LIB="%@P%\..\lib";\dm\lib;"C:\Program Files (x86)\Windows
> Kits\8.0\Lib\win8\um\x86";%DMD_LIB%

You should not pass the path to COFF libraries in the SDK to the Win32 
linker, it only understands libraries in OMF format (coffimplib needed 
to convert the libraries).

>
> [Environment64]
> ; original LIB="%@P%\..\lib64"
> LIB="%@P%\..\lib64";\dm\lib;"C:\Program Files (x86)\Windows
> Kits\8.0\Lib\win8\um\x64";%DMD_LIB%

What version of DMD are you using? DMD 2.064 was tweaked to have the 
path to the SDK libraries in sc.ini. Unfortunately it is not working 
with the Windows SDK 8.1, as Microsoft changed the SDK layout again.

Visual D also allows setting additional library paths in the 
Tools->Options->Project and Solution->Visual D Settings->DMD 
Directories->x64 page.


More information about the Digitalmars-d-ide mailing list