2024-01-08 11:20:41

rust-环境搭建

rust-环境搭建-MinGW

x86_64-pc-windows-gnu MinGW
x86_64-pc-windows-msvc VC++

MinGW

gcc -v gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)

下载rustup

https://www.rust-lang.org/learn/get-started

安装路径指定

默认路径

C:\Users\user\.rustup
C:\Users\user\.cargo

指定路径
CARGO_HOME -> D:\Program Files\RusT\cargo

RUSTUP_HOME -> D:\Program Files\Rust\rustup

安装

取消Visual C++

image.png

自定义安装

image.png

使用 MinGW

x86_64-pc-windows-gnu
image.png

可选配置

image.png

再次选择MinGW

image.png

完成

image.png

验证

image.png
image.png

编译测试

image.png
image.png

加速配置

D:\Program Files\RusT\cargo\config

[source.crates-io] # To use sparse index, change 'rsproxy' to 'rsproxy-sparse' replace-with = 'rsproxy' [source.rsproxy] registry = "https://rsproxy.cn/crates.io-index" [source.rsproxy-sparse] registry = "sparse+https://rsproxy.cn/index/" [registries.rsproxy] index = "https://rsproxy.cn/crates.io-index" [net] git-fetch-with-cli = true

vscode插件

image.png

本文链接:https://blog.zxysilent.com/post/rust-install.html

-- EOF --

Comments