Installing rust environment under Win10

Install according to the instructions on the official website, and then execute

> cargo build
   Compiling rust-demo v0.1.0 (E:\rust\rust-demo)
error: linker `link.exe` not found
  |
  = note: 系统找不到指定的文件。 (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, VS 2017 or VS 2019 was installed with the Visual C++ option

error: aborting due to previous error

error: could not compile `rust-demo`.

To learn more, run the command again with --verbose.

There are different opinions on this error, and maybe they are all right, given their circumstances. But I tried many ways to no avail.

Final solution:

1. Go to Microsoft’s official website to download vs_community__1980043881.1626916635.exe (you should know that the following numbers are version numbers, so don’t worry)

2. Select the red box in the picture below to install, and then restart the computer.

 If you insist on trying to install visualcppbuildtools_full.exe, you may encounter a lot of problems and be unable to install it. It's simpler to handle it this way.

Guess you like

Origin blog.csdn.net/HardRedStone/article/details/118995191