Link.exe not found

I just installed rust but I'm getting a 'link.exe not found' error. After searching around I find it seems to be caused by somthing about the visual studio build tools. But I can't get any clear idea about what to do about it.

As far as I can tell I have the build tools installed.

Download and install visual studio community edition, as that's what has all of the pre-reqs and more. That's what worked for me.

I downloaded community edition and installed it. Still can't find linker.exe.

Could you try to find x## Native Tools Command Prompt for VS #### in the windows search bar? Once you're there, try running link and it should give you a little speech about its various parameters.

It it doesn't then there's something wrong with the installation. For example, I have 2017 installed with C++ build tools installed so it works in x64 Native Tools Command Prompt for VS 2017 but it doesn't in the 2019 version because I forgot to click on C++ Build tools there.

I did the search and only got web hits.

I did a serch on ' developer command prompt' and got to a prompt:

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>

I tried to run link from there and got no recognized command. So something is wrong with the install? I did a windows install by downloading an installation program. I don't remember ever seeing a 'C++ Build tools' to click on.

So how do I fix this mess? Uninstall and try again?

Ah, okay, then perhaps following these steps:

  • Go to the location where your VS is installed and find the installer in C:\Program Files (x86)\Microsoft Visual Studio\Installer. Run vs_installer.exe which could either update or just run. If it asks for an update, do it.

  • You should see something similar to the following:

  • From here click on More ▾ Modify

  • Then toggle, under Windows, "Desktop development with C++":

  • Then click Modify

  • Wait.

That worked! Thanks! You are a peach!

1 Like

Do i need to install all packages in 'Desktop development with c++' or some specific packages are sufficient?

I'd just install the entire thing if space wasn't an issue, but if it was, I'd probably try some more and more progressively until you find the right combination.

You probably want packages that mention the following:

  • C++ Compiler
  • C++ Core
  • MSBuild? (I'm not sure)
  • VC++ Libraries perhaps?