问题
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)
test2project PS C:\Users\parik> cargo build error: could not findCargo.tomlinC:\Users\parikor 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: linkerlink.exenot found | = note: The system cannot find the file specified. (os error 2)note: the msvc targets depend on the msvc linker but
link.exewas not foundnote: 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.
回答1:
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
回答2:
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.
来源:https://stackoverflow.com/questions/59171127/link-exe-not-found-error-while-running-on-windows-system-for-rust-program-is-vi