Bug 19445 – Linking to lib under c:\Program Files (x86) does not work in Visual D
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
visuald
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2018-11-29T06:16:48Z
Last change time
2018-12-22T15:17:22Z
Assigned to
No Owner
Creator
Russell Haley
Comments
Comment #0 by russ.haley — 2018-11-29T06:16:48Z
Hello,
I'm absolutely new to D and I wanted to say: wow! What a great toolchain so far.
Anyway, I am testing sslsocket.d from https://github.com/adamdruppe/arsd. I was trying to link to libressl libraries that are stored under C:\Program Files (x86)\LibreSSL\lib.
I go into Project Properties->Configuration Properties->Linker->General and add the Library files through the file selector. The value in the text box is:
"..\..\..\..\..\..\Program Files (x86)\LibreSSL\lib\ssl.lib
*Note the solitary double quote.
The linker error is thus:
------ Build started: Project: DApp1, Configuration: Debug Win32 ------
Building Win32\Debug\DApp1.exe...
"Win32\Debug\DApp1.obj" /OUT:"Win32\Debug\DApp1.exe" ""..\..\..\..\..\..\Program Files (x86)\LibreSSL\lib\ssl.lib" >> C:\Users\russh\source\repos\DApp1\DApp1\Win32\Debug\DApp1.link.rsp
LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
LINK : fatal error LNK1159: no output file specified
Building Win32\Debug\DApp1.exe failed!
Details saved as "file://C:\Users\russh\source\repos\DApp1\DApp1\Win32\Debug\DApp1.buildlog.html"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I tried various quoting machinations to no avail. I am reporting this error because I managed to build by linking from a different directory that has no spaces in the path.
I also noted that the library search path box produced the same single quote when I tried with program files (x86).
Cheers,
Russ
Comment #1 by russ.haley — 2018-11-29T06:20:12Z
Oh, sorry, I am using VS 2017 (15.8.1) and VisualD 0.47.0.
Comment #2 by r.sagitario — 2018-12-06T08:19:54Z
Thanks for the report.
Indeed, selecting a library with the file selector should add a pair of quotes if there are spaces in the name. I can reproduce it not working in that case, too.
The current workaround would be to use the short names (e.g. "progra~2")without quotes but these are not portable to other systems.
Quoting the library search path seems ok, too, so you can also add the library without path and add its path as a search path (with the trailing quote).