1
votes

I am getting link.exe not found issue , is there anything more i have to install?

PS C:\Users\parik> cargo new test2 Created binary (application) test2 project PS C:\Users\parik> cargo build error: could not find Cargo.toml in C:\Users\parik or any parent directory PS C:\Users\parik> cd test2 PS C:\Users\parik\test2> cargo build Compiling test2 v0.1.0 (C:\Users\parik\test2) error: linker link.exe not found | = note: The system cannot find the file specified. (os error 2)

note: the msvc targets depend on the msvc linker but link.exe was not found

note: please ensure that VS 2013, VS 2015 or VS 2017 was installed with the Visual C++ option

error: aborting due to previous error

error: Could not compile test2.

2
Read the messages: note: please ensure that VS 2013, VS 2015 or VS 2017 was installed with the Visual C++ optionhellow

2 Answers

5
votes

There are two existing Rust toolchain families provided for Windows:

  • msvc
  • gnu

msvc is the default, and as you realized, depends on a recent Visual C++ installation.

gnu on the other hand depends on GNU/MinGW-w64. It can be installed and made the default toolchain using:

$ rustup default stable-x86_64-pc-windows-gnu
0
votes

Yes, you have to install VC+ build tools so that rustc should be able to autodetect the helper files. Or you can go with the VS 2013 or 2015(for autodetection). For more information please refer this.