Windows下安装Rust

https://www.rust-lang.org/
原来中文站首页ZH-CN不知道怎么的没有办法进入了,下载需要从英文站下载。

It looks like you’re running Windows. To install Rust, download and run  这里。


从网站的标签install进入,然后点击rustup-init.exe,下载这个可执行文件,执行,就可以了。自动下载需要的文件然后安装。
但是有可能有各路的Visual Studio问题挡道。我是重新装了一遍windows,赶紧装了vs,不然还是不能安装。

这里选择1,proceed就可以了,不然也可以自己去选择定制安装。

写一个hello测试:

文件名hello1.rs

// This is the main function
fn main() {
   // The statements here will be executed when the compiled binary is called
   // Print text to the console
    println!("Hello World!");
}

编译它

>rustc hello1.rs

文件夹下多了一个文件hello1

>hello1

输出:

Hello World!

rustc的版本

rustc --version

目前是1.32.0

 

卸载:rustup self uninstall

运行 rustup -h 你将会得到命令提示:

现rustup是1.16版本

默认安装到C:\Users\[USER]\.cargo\bin 中  [USER]是当前用户名

如果实在安装不上:前方高能————

登录play.rust-lang.org先试试在线程序吧,毕竟忙活了这么久。

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值