Why rustc command doesn't work?

C:\Users\Human No.1>rustc "%userprofile%\projects\Hello_world\hello_world.rs
error: linker link.exe not found
|
= note: program not found

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, VS 2019 or VS 2022 was installed with the Visual C++ option

error: aborting due to previous error

It says that Visual C ++ is needed. But how to install it? It isn't present in VS 2022 installer.

It was called something like "Build Tools" previously, doesn't the installer have something like this now? I'm on Linux, so can't check myself.

1 Like

The option in the Visual Studio installer may be called "Windows 8/10/11 SDK for C++".

Here's a screenshot I have lying around that might help. The most essential parts are the optional components: "MSVC v143" and "Windows 10 SDK" (or "Windows 11 SDK" but it doesn't matter too much which version although generally newer is better)

1 Like