Resolving “`link.exe` not found” Error in Rust

If you’ve encountered the “link.exe not found" error while running “cargo install cargo-generate" , here’s how you can fix it.


Installing “Build Tools for Visual Studio 2022" under “Desktop development with C++" resolved the error.

The Issue

You decided to explore Rust for controlling a Raspberry Pi Pico, and when you ran “cargo install cargo-generate," you encountered the “linker 'link.exe’ not found" error midway.


After some investigation, I found a solution on a website. However, the instructions were for Visual Studio 2019, and the names and items differed. So, here’s a record of what worked for me.

Download Build Tools for Visual Studio 2022

Visit the Visual Studio download site.
Scroll down a bit and find “Build Tools for Visual Studio 2022" under “Tools for Visual Studio 2022."
Download it from


  • Run vs_BuildTools.exe.
  • Check the box for “Desktop development with C++."
  • Proceed with the installation.

Completion and Success

Once the installation was complete, the process that was previously failing now worked without any issues.