2023-09-18 更新:
出现此问题是因为 Windows SDK 没有正确安装,正确安装
Windows SDK 后问题解决。
-----------------------------------------------------------------
使用以下方式也可以解决(不推荐):
官方推荐的 toolchain 是 stable-x86_64-pc-windows-msvc,但按照步骤安装完成后并不能正常工作,编译报错:error: linker `link.exe` not found
我将 stable-x86_64-pc-windows-msvc 卸载,更换为 stable-x86_64-pc-windows-gnu 问题解决。
在 cmd 中按顺序执行以下三条命令:
rustup uninstall toolchain stable-x86_64-pc-windows-msvc
rustup toolchain install stable-x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnu