Error: linker ` link. Exe ` not found | = note: the system cannot find the specified file.

Error: linker ` link. Exe ` not found | = note: the system cannot find the specified file. (os error 2)”
PS C:\Users\sun\Desktop\runoob-greeting> cd .\greeting
PS C:\Users\sun\Desktop\runoob-greeting\greeting> cargo build
Compiling greeting v0.1.0 (C:\Users\sun\Desktop\runoob-greeting\greeting)
error: linker link.exe not found|= note: The system could not find the specified file. (os error 2)
note: the msvc targets depend on the msvc linker but link.exe was not found
The problem occurs in the context of: Rust’s build tools and package management tools – Cargo

Solution.
Install Visual Studio 2019 build tools Visual Studio 2019 build tools or Microsoft Visual Studio. after downloading build tools, in Visual studio installer select only ” C++ build tools”, then select only “MSVC v142 – VS2019 C++ x64/x86 build tools”.

Read More: