Rust Windows环境搭建

该文章主要讲述在windows10+vscode下如何构建一个完整的rust编译调试环境,以及过程中可能出现的问题。

Rust构造

rust 官方提供了一系列版本、包安装管理工具,如rustup和cargo。

基本组件

rustup

初始化

rustup.rs官网下载rustup-init.exe(其他平台同理),这个软件是一个初始配置包,会帮助你下载选择版本的rustup和cargo。

打开软件后会显示如下信息(translated):

Welcome to Rust!
欢迎来玩Rust!

This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.
本向导将会下载并安装Rust官方编译器与包管理工具Cargo。

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:
接下来会将cargo、rustc、rustup等二进制文件下载到Cargo的bin文件夹下:

  ~\.cargo\bin

This path will then be added to your PATH environment variable by modifying the
HKEY_CURRENT_USER/Environment/PATH registry key.
该路径将会添加至当前用户的PATH环境变量中。

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.
你可以自由卸载,并恢复至初。

Current installation options:
当前安装参数:

   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)     确认并安装(默认)
2) Customize installation                  自定义安装
3) Cancel installation                     取消安装
> _

默认安装于用户目录下。

该软件默认检查环境变量CARGO_HOMERUSTUP_HOME,分别为.cargo.rustup设置目录,按需修改(需要注意的是后期包的累积可能会占用巨量的存储空间)。

安装过程中请选择第二项 “Customize installation”

  • 9
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值