Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does the Visual Studio 32-bit linker find the 64-bit linker?

I have a moderately large DLL, and when I link it, I get the error:

LINK : the 32-bit linker (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\
link.exe) ran out of heap space; restarting link with the 64-bit linker 
(C:\Program Files\Git\usr\bin\link.exe)

(line breaks added for readability)

As you might expect, using the Posix program to create symbolic or hard links with command line options intended for the Microsoft linker doesn't end well. (Specifically, it returns /c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/link: cannot create link ''$'\377\376''/' to '/ERRORREPORT:QUEUE': No such file or directory)

How does the 32-bit Visual Studio linker find the 64-bit one? How can I persuade it to find the right one?

like image 381
Martin Bonner supports Monica Avatar asked Sep 12 '18 14:09

Martin Bonner supports Monica


1 Answers

This is a known problem that should be fixed soon : https://developercommunity.visualstudio.com/content/problem/331351/linkexe-should-not-search-path-for-64-bit-version.html

Workaround : This is definitely not a clean way to fix this but, adding C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\<14.16.xxxxxxxx>\bin\Hostx64\x64 ad the beginning of the PATH helped.

Of course, replace <14.16.xxxxxxxx> with the VC++ tool version that fits your working environment.

like image 56
Steven Avatar answered Sep 21 '22 02:09

Steven