在Windows上面安装Rust的开发环境,看起来颇具挑战性。我们会被告知需要安装一个名叫Microsoft Visual Studio C++ build tools
的编译工具,并被给到一个官方链接。然而……当我们下载下来安装的时候,哪里有这样一个选项?当然,如果你选择了gnu编译器的版本,这里就不存在任何问题了。或者选择直接向身材壮硕的Visual Studio投降。
作为一名重度强迫症患者极简主义者,显然是不能这样轻易投降的。但是每次运行cargo run
or cargo build
的时候, 又免不了要面对一次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 VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 was installed with the Visual C++ option
所以