Avatar ·

Rust compilation error on Windows: linker link.exe not found

Hi everyone! I just started learning Rust and encountered a problem when trying to compile a simple "Hello, world!" program.\n\nI installed Rust via rustup-init.exe, everything went successfully. I created a new project using `cargo new hello_world`, navigated to the project folder. In the main.rs file I have this code:\n\n```rust\nfn main() {\n println!("Hello, world!");\n}\n```\n\nI try to compile using `cargo build` and get this error:\n\n```\nerror: linker `link.exe` not found\n |\n = note: The system cannot find the file specified. (os error 2)\n```\n\nI'm on Windows 10, 64-bit. Apparently, Rust cannot find the linker. I tried reinstalling Rust, but it didn't help. Online it says I need to install Visual Studio or Build Tools, but I'm not sure what exactly to install and which