pari kannappan
pari kannappan

Reputation: 31

link.exe not found error while running on windows system for rust program, is Visual C++ mandatory for Cargo?

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.

Upvotes: 2

Views: 4565

Answers (2)

SirDarius
SirDarius

Reputation: 42879

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

Upvotes: 11

Pawan Bisht
Pawan Bisht

Reputation: 211

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.

Upvotes: 0

Related Questions