win安装rust环境(mingw)

官网下载安装文件
 
安装mignw
 
修改系统环境变量
名称 - 值
RUSTUP_DIST_SERVER : https://mirrors.ustc.edu.cn/rust-static
RUSTUP_UPDATE_ROOT : https://mirrors.ustc.edu.cn/rust-static/rustup
 
运行 init
提示没有安装编译工具
选择继续
 
选择2自定义
default host triple
x86_64-pc-windows-gnu
default toolchain
stable
modify PATH variable
yes
 
选择1进行安装
等待下载完成
 
.cargo/bin会自动添加到系统环境变量path中
手动把mignw的路径也添加到系统环境变量path中
 
测试
rustup --version
rustup update
rustup show
 
F:\>cargo new hello
Created binary (application) `hello` package
 
F:\>cd hello
 
F:\hello>cargo run
Compiling hello v0.1.0 (F:\hello)
Finished dev [unoptimized + debuginfo] target(s) in 2.69s
Running `target\debug\hello.exe`
Hello, world!
 

猜你喜欢

转载自www.cnblogs.com/gzbkey/p/11775390.html