Rust errors / Build and Cargo
Rust build error · checked with Rust 1.99.0
error: linker `link.exe` not found
error: linker `link.exe` not found
What it meansOn Windows, Rust's default target (x86_64-pc-windows-msvc) links with Microsoft's linker, which comes with Visual Studio Build Tools, not with Rust.
Why it happens
- Rust installed with rustup but the Visual Studio C++ build tools were never installed.
- Build Tools installed without the "Desktop development with C++" workload (or the Windows SDK).
- A shell that cannot find the tools (rare; rustup finds them through the registry).
How to fix it
1. Install the C++ build tools
Install Visual Studio Build Tools with the "Desktop development with C++" workload (MSVC and a Windows SDK), then open a new terminal.
winget install Microsoft.VisualStudio.2022.BuildTools --override "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --passive"2. Or use the GNU toolchain
Works without Visual Studio, but some crates expect MSVC.
rustup toolchain install stable-x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnuOther wordings of this error
linker link.exe not found, note: the msvc targets depend on the msvc linker but `link.exe` was not found, msvc linker not found rust
Other build errors
- error: linker `cc` not found
- error: failed to run custom build command for `openssl-sys`
- error: failed to select a version for the requirement
- error: failed to select a version for `libsqlite3-sys`... the package `libsqlite3-sys` lin
- error: could not compile `my-crate` (bin "my-crate") due to 1 previous error
- error: package `foo v1.2.3` cannot be built because it requires rustc 1.80 or newer, while
- feature `edition2024` is required
- Blocking waiting for file lock on package cache
Up next
Find the right pagePaste any Rust errorCompiler codes and build errors in one finder.Read it next →Also worth your time
Did this answer your question?