9

I'm a beginner who's just barely started learning Rust online, and I want to now use Rust on my computer. I installed the Rust installer, ran it, and it output this message:

Rust requires the Microsoft C++ build tools for Visual Studio 2013 or later,
but they don't seem to be installed.

I installed the Microsoft C++ 2017 build tools and restarted my computer, but it still outputs this error. From looking on Github, I understand that a lot of people have this issue, but the comments are full of technical jargon that I don't understand.

How can I set Rust up so it works? (Explained so that a beginner can understand)

Ben Gubler
  • 1,393
  • 3
  • 18
  • 32
  • The VS Build tools are notoriously difficult to find: on the website, on your PC (subtle but important differences between minor/major versions, etc). Last time I tried installing the VS2017 build tools, the installed size (bare minimum of C++ development with latest toolchain) was larger than the equivalent VS2017 Community install. So I just gave up on them and installed the "normal" IDE package. – rubenvb May 18 '18 at 09:37
  • Does https://stackoverflow.com/a/47380501/3005167 answer your question? – MB-F May 18 '18 at 09:51
  • @kazemakase no, I don't have the MinGW linker. I just want to figure out how to get my VS C++ build tools to work with Rust – Ben Gubler May 18 '18 at 10:03
  • Here you go: http://landinghub.visualstudio.com/visual-cpp-build-tools – Richard Critten May 18 '18 at 10:04
  • @RichardCritten I downloaded those and restarted my computer, but Rust is still throwing the same error. – Ben Gubler May 18 '18 at 10:10
  • @BenGubler You don't need the MinGW linker, rustup will get you anything it needs. I'd argue that the GNU toolchain is the simpler approach if you just want to work with rust, but [YMMV](https://www.urbandictionary.com/define.php?term=ymmv) :) – MB-F May 18 '18 at 10:10
  • @kazemakase what should I do to install? It keeps throwing the error described in my question-- should I select the `continue` option? Would that impact any features? – Ben Gubler May 18 '18 at 10:15
  • This may be a path issue, try installing rust from the "Developer Command Prompt" start menu item. – user25064 May 18 '18 at 14:16
  • Can you confirm you followed [these steps](https://github.com/rust-lang-nursery/rustup.rs/issues/1363#issuecomment-369953262)? – Shepmaster May 18 '18 at 14:38
  • Possible duplicate of [\`cargo build\` fails with linking error "link.exe failed: exit code: 325595"](https://stackoverflow.com/questions/50337099/cargo-build-fails-with-linking-error-link-exe-failed-exit-code-325595) – Stargateur May 18 '18 at 14:40

1 Answers1

7

I found the answer! Turns out I was installing 'Microsoft Visual C++ Redistributable for Visual Studio 2017' instead of 'Build Tools for Visual Studio 2017'. Funny how a simple error can cause a lot of headache!

Ben Gubler
  • 1,393
  • 3
  • 18
  • 32