D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13759 - VS2010 Win64 linker path wrong
Summary: VS2010 Win64 linker path wrong
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: visuald (show other issues)
Version: D2
Hardware: x86_64 Windows
: P1 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-21 02:21 UTC by Manu
Modified: 2015-06-09 05:14 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Manu 2014-11-21 02:21:25 UTC
Fresh install of VisualD (0.3.40-b1) into VS2010.
New console app, solution defaults to 32bit, add 64bit via the configuration manager, try and build, linking fails, complains about mspdb100.dll.

The problem:
tools -> options -> project and solutions -> visual d settings -> dmd directories -> x64 tab

The x64 tab has some additional options, particularly: "override linker settings from sc.ini" which is ticked, and the path in linker defaults to $(VCINSTALLDIR)\bin\link.exe

This path is wrong, that is the 32bit linker. The correct path is: $(VCINSTALLDIR)\bin\amd64\link.exe

I changed the path and it works as expected.
Comment 1 Rainer Schuetze 2014-11-22 15:26:21 UTC
Actually the 32-bit linker is used explicitely because 

- it works just as well to build x64 binaries
- it allows building x64 executables on 32-bit systems
- the filemonitor that records dependencies only works with the 32-bit linker

I guess what's wrong instead is that the PATH environment variable or the executable path settings contain the path to the amd64 folder, so that the wrong mspdb100.dll is found.

Maybe the linker executable has to be analyzed for its architecture to set the appropriate PATH.

> Fresh install of VisualD (0.3.40-b1) into VS2010.

BTW: in case you missed that, there is a beta2 with basic C++ support.
Comment 2 Manu 2014-11-22 16:00:56 UTC
Hmmm. So you really think the settings are correct? Well it needs to be fixed in some way that it actually works at least :)
I'll leave that decision with you, but in my case, I updated the path to point to the 64bit linker and had no problems... what problems should I expect?

I had noticed the updates. I've been in the process of moving house and starting a new job recently, so I haven't had a chance to try it out, but I'll get on to it some time soon and let you know how I go :)

Thanks again!
Comment 3 Rainer Schuetze 2014-11-22 17:19:39 UTC
(In reply to Manu from comment #2)
> I'll leave that decision with you, but in my case, I updated the path to
> point to the 64bit linker and had no problems... what problems should I
> expect?

Obviously, the settings didn't match for your installation. I'll have to check where the appropriate DLLs are in a VS2010 installation, but I don't have that version on my computer ATM. My guess is that $(VSInstallDir)\Common7\IDE needs to added to PATH, but not if the 64-bit linker is used.

The expected problem is that "monitoring OPTlink" will not work, it's also tried with the MS linker. The net effect is that the project always wants to rebuild.

> 
> I had noticed the updates. I've been in the process of moving house and
> starting a new job recently, so I haven't had a chance to try it out, but
> I'll get on to it some time soon and let you know how I go :)

np, and good luck with your new job. If you find the time, it'd be nice if you could check whether the reported bugs that I couldn't reproduce, are still valid: Issue 13198, 11549/11033, 12021, 11029.
Comment 4 anonymous4 2014-11-25 10:21:16 UTC
On my installation of VS2010 vcvars64.bat adds Common7\IDE to path, but VC\BIN\amd64 comes first, so 64-bit mspdb100.dll is picked from there.
Comment 5 Manu 2014-11-27 00:03:55 UTC
I just installed DMD+VisualD on another fresh installation with VS2010, and the same problem.
It definitely doesn't work on fresh installs with 2010. The linker path just needs to be set to bin/amd64/link.exe instead of bin/link.exe and it's fine.
Comment 6 Rainer Schuetze 2014-11-29 15:05:20 UTC
I couldn't install VS2010, but it seems the problem also exist on VS2012:

- the 32-bit link.exe is in $(VSINSTALLDIR)\VC\bin
- the 32-bit mspdb110.dll is in $(VSINSTALLDIR)\Common7\IDE
- the 64-bit link.exe is in $(VSINSTALLDIR)\VC\bin\amd64
- the 64-bit mspdb110.dll also is in $(VSINSTALLDIR)\VC\bin\amd64

As long as the DLL is in the same folder as the linker executable, it should be fine. In VS2013, $(VSINSTALLDIR)\VC\bin also contains mspdb120.dll, so you don't run into any issues.

So, to make both 32bit and 64-bit linker work, adding $(VSINSTALLDIR)\Common7\IDE to the executable paths should do the trick.
Comment 7 Rainer Schuetze 2014-11-29 17:29:17 UTC
Next time you have to install Visual D, please try https://github.com/D-Programming-Language/visuald/releases/tag/v0.3.40-beta3
Comment 8 sdv 2014-12-04 11:49:02 UTC
please try remove  C:\Program Files (x86)\VisualD\filemonitor.dll
Comment 9 Rainer Schuetze 2015-01-01 22:01:02 UTC
(In reply to sdv from comment #8)
> please try remove  C:\Program Files (x86)\VisualD\filemonitor.dll

Replaced by tracker.exe from msbuild now.
Comment 10 Rainer Schuetze 2015-01-01 22:02:12 UTC
fix released in 0.3.40.