在 Windows 上安装 Rust [英] Rust installation on Windows
问题描述
我试图让 Rust 在我的 Windows 机器上工作.我按照说明操作,但是当我尝试 hello world 程序时,它会吐出以下内容.看起来它无法链接到 gcc .. 我有 gcc 在那里.有人可以帮我弄清楚这里的问题是什么吗?
I was trying to get Rust to work on my Windows box. I followed the instructions, however when I tried hello world program, it spits the below. It looks like it has not been able to link up to gcc.. and I have gcc out there. Could someone help me figure out what is the issue here?
$ rustc foo.rs
error: linking with `gcc` failed: exit code: 1
note: gcc arguments: '-m32' '-LC:\Program Files (x86)\Rust\bin\rustlib\i686-pc-m
ingw32\lib' '-o' 'foo' 'foo.o' '-shared-libgcc' '-LC:\MinGW\msys\1.0\home\ENwank
wo\.rust' '-LC:\MinGW\msys\1.0\home\ENwankwo' 'C:\Program Files (x86)\Rust\bin\r
ustlib\i686-pc-mingw32\lib\libstd-3e5aeb83-0.9.rlib' 'C:\Program Files (x86)\Rus
t\bin\rustlib\i686-pc-mingw32\lib\libgreen-83b1c0e5-0.9.rlib' 'C:\Program Files
(x86)\Rust\bin\rustlib\i686-pc-mingw32\lib\librustuv-2ba3695a-0.9.rlib' '-lws2_3
2' '-lpsapi' '-liphlpapi' '-lmorestack'
note: gcc: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found
compilation terminated.
error: aborting due to previous error
task 'rustc' failed at 'explicit failure', C:\bot\slave\dist2-win\build\src\libs
yntax\diagnostic.rs:75
task '<main>' failed at 'explicit failure', C:\bot\slave\dist2-win\build\src\lib
rustc\lib.rs:453
推荐答案
这个问题很老了,但同时发生了很多变化.
This question is old, but in the mean time a lot has changed.
在 Windows 上安装的最简单方法是转到 Rust 安装页面 并下载并运行 rustup-init.exe.它安装 rustc
、rustup
和类似的工具.它只是有效™.
The easiest way to install on Windows is to go to the Rust installation page and download and run rustup-init.exe. It installs rustc
, rustup
and similar tools. It just works™.
这篇关于在 Windows 上安装 Rust的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!