link.exe not found error when building Rust on Windows 11 (MSVC target)

โš“ Rust    ๐Ÿ“… 2025-08-20    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 5      

surdeus

Hey Rustaceans,

I recently switched from Linux to Windows 11 and installed Rust. Cargo commands work fine, but when I try to build a project I get this error:

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 Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.

I installed Visual Studio 2022 and Build Tools 2022 with the C++ workload, but Rust still canโ€™t find link.exe. I even tried using WSL (Ubuntu) and installing the MSVC target there, but it still fails.

I couldnโ€™t locate link.exe to set a path manually. How can I correctly compile Rust for the x86_64 MSVC target on Windows 11?

Any guidance is appreciated!

3 posts - 3 participants

Read full topic

๐Ÿท๏ธ Rust_feed