Bug 17355 – Path to lib64 and $(DMDInstallDir) not correct

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
visuald
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2017-04-26T21:10:00Z
Last change time
2017-06-05T17:04:00Z
Assigned to
nobody
Creator
thomas.hedstrom

Comments

Comment #0 by thomas.hedstrom — 2017-04-26T21:10:07Z
After installing DMD 2.074.0 and Visual D 0.44.2 the DMD x64 builds cannot find phobos64.lib. (LINK : fatal error LNK1104: cannot open file 'phobos64.lib') Using VS2017 Community (Toolset 2017 and/or toolset 2015 tested thinking it was a linker problem). After some more testing it seems there are maybe two problems: 1. When adding and absolute path to "C:\D\dmd2\windows\lib64" in Visual D global settings "Library path" it works. Missing library path to lib64 ? 2. But, trying relative path $(DMDInstallDir)windows\lib64 to conform with other path settings, it does not work. During compilation the $(DMDInstallDir) seems to be ".\", seems wrong. Variables: DMDInstallDir=.\ VCTOOLSINSTALLDIR=P:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\ VSINSTALLDIR=P:\Program Files (x86)\Microsoft Visual Studio\2017\Community\ WindowsSdkDir=C:\Program Files (x86)\Windows Kits\8.1\ Note: Compilation from command line "dmd -m64" on the same source works regardless.
Comment #1 by thomas.hedstrom — 2017-04-26T21:16:33Z
Additional notes: No other Visual Studio versions are installed, although the new vs2017 is installed on another drive (not c: ).
Comment #2 by r.sagitario — 2017-04-27T06:55:11Z
This sounds like the DMD install path wasn't detected or set during installation or later. This might happen if you install Visual D before dmd. Please check the respective setting "DMD install path" on the global options page.
Comment #3 by thomas.hedstrom — 2017-04-28T21:17:06Z
After a lot of uninstalling/installing DMD/VisualD, my previous global settings for library path etc was still not "refreshed". I suspected some remains from older installations so resided to removing all of Visual D remains in the registry / VisualStudio settings manually. Quite a lot. When I finally got a hopefully fresh set of global "Visual D Settings" it was back to the same problem as before, $(DMDInstallDir) = .\ Though it seems to have found the path since in the registry it's correct. Found two keys named "DMDInstallDir" = "C:\D\dmd2". Under: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\VisualD and HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\15.0\ToolsOptionsPages\Projects\Visual D Settings Setting the "DMD install path" manually in the global settings will do as a work-around but it does not seem to fill it in automatically. Also, is there a need for an option to force clean/default settings during installation maybe?
Comment #4 by r.sagitario — 2017-04-29T06:53:44Z
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\VisualD is where the installer remembers the setting made during installation. For each Visual Studio version that you choose for Vsiual D installation, it is also set at HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\<VS-Version>\ToolsOptionsPages\Projects\Visual D Settings When starting VS, it copies these settings to the user hive: HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\<VS-Version>_Config\ToolsOptionsPages\Projects\Visual D Settings If you change any global option for Visual D it saves all of them (including DMDInstallDir) to HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\<VS-Version>\ToolsOptionsPages\Projects\Visual D Settings Please note that the last two registry keys are defined by VS and passed to Visual D. To start from scratch, you need to cleanup the latter. For VS 2017 these registry hives are mapped into a "private" registry that you can only edit with regedit using "Load hive". So there is little the installer can do to cleanup the settings. The extra step writing the installer value into the VS registry seems gratuitous, though, and might be actually causing the problems for VS2017. Reading the default from the Visual D installer key should be better.
Comment #5 by r.sagitario — 2017-06-05T17:04:00Z
Now also reading the installer registry keys of Visual D and DMD. Fixed in https://github.com/dlang/visuald/releases/tag/v0.45.0-beta1