Rust 问题汇总
你好! 欢迎来到 Rust 问题汇总,在这里你查找在你进行 Rust 编程过程中遇到的问题。
安装问题
问题一:error: linker link.exe
not found
- windows 安装 Rust 成功后,编写 hello 程序出现
error: linker `link.exe` not found
|
= note: 系统找不到指定的文件。 (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, VS 2017 or VS 2019 was installed with the Visual C++ option
error: aborting due to previous error
error: could not compile `hello-rust`.
该问题是因为rust编译程序需要vs c++编译工具,如果缺少 C++ build tools 会导致(如果计算机上未安装 Visual Studio,则 Microsoft 生成工具 2015 可提供用于生成托管应用程序的必要工具。)
解决:
- 安装 C++ build tools,地址:C++ build tools.(已验证,安装完[3.12G]即可解决问题)
- 下载 Visual Studio 安装包,然后选择 C ++工具,在选项只选 MSVC v142 - VS2019(或2015/2017) C++ x64/x86 生成工具,安装成功后重启电脑。(此方法单独安装,验证失败,不知道哪个依赖库没有找到;建议可进行完整安装试试,完整安装未验证!!!)