【发布时间】:2019-08-31 08:31:14
【问题描述】:
我已经从Rust installation page 在 Windows 上安装了 Rust。安装后我尝试运行“hello world”程序,但出现以下错误。
>cargo run
错误
Compiling helloworld v0.1.0 (C:\Users\DELL\helloworld)
error: linker `link.exe` not found
note: The system cannot find the file specified. (os error 2)
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015 or VS 2017 was installed with the Visual C++ option
error: aborting due to previous error
error: Could not compile `helloworld`.
To learn more, run the command again with --verbose.
代码:
fn main() {
println!("Hello, world!");
}
【问题讨论】:
-
错误信息准确地说明了要做什么:"注意:请确保已使用 Visual C++ 选项安装了 VS 2013、VS 2015 或 VS 2017"
-
是的,认为它可能对其他人有用,因此与其答案分享了这个问题。
-
@hellow 不太“完全”,这就是整个问题.... Visual Studio 安装程序有大约 30 个选项,安装它们可能需要 TB 的下载量。下面的 filiphagan 很有帮助地提到了必要的内容。
-
@Merk "[...] 是使用 Visual C++ 选项安装的" 我的意思是...它不会告诉您安装所有东西,是吗?
-
@hellow "exactly" 建议“有足够的信息从列表中挑选项目”,考虑到列表中有 Visual C++ 和 VS 20xx 的(多 Gb)选项数量,情况并非如此,正如下面的多个答案所证明的那样。对此问题的有益评论将有助于区分它们。
标签: compiler-errors installation rust linker-errors build-tools