239|2

9

帖子

0

TA的资源

一粒金砂(中级)

楼主
 

嵌入式 Rust 修炼营:win10安装rust +mingw64 [复制链接]

 

1.基础介绍

  参加此次活动,主要原因是之前学习rust从入门到放弃,没有一个实战的小项目,于是可以通过这次机会,结合嵌入式小板子学习rust。主要是windows上使用,可能会比较麻烦,因此参考了很多贴子。搭建前需要准备 安装vscode 、配置mingw64[

链接已隐藏,如需查看请登录或者注册
]或者msvc [vs_build_tool.exe]【mingw64和msvc 二选一即可  安装过程以mingw64为例 】
     x86_64-14.2.0-release-posix-seh-ucrt-rt_v12-rev1.7z  版本选最新的就行  win上使用标红版本较好。下载后大概79M,解压到自己常用文件夹 ,并添加到环境变量中 [D:\Program Files (x86)\mingw64\bin] 比较轻量级。msvc 下载完3G左右文章最后有示例。

2.安装

2.1 安装rust

   配置用户环境变量 
        RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
        RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup

       CARGO_HOME    D:\rust\cargo_home
       RUSTUP_HOME   D:\rust\rust_home

 

 下载rustup-init.exe[rust官网]选择Download rustup-init.exe (64-bit)
下载完成执行,因为此次需要使用mingw64 作为rust的c++环境,rust在win上的安装程序默认是msvc,需要选择3  后续设置c++环境;
进入了安装流程,rust会识别到 刚才配置的rust 环境变量
default的还是只用 msvc 选择2 自定义

手动修改 【x86_64-pc-windows-gnu】

后续的配置直接回车使用defult, 最后一个直接回车 

 
  • Current installation options:
  • default host triple: x86_64-pc-windows-gnu
  • default toolchain: stable
  • profile: default
  • modify PATH variable: yes
  • 1) Proceed with selected options (default - just press enter)
  • 2) Customize installation
  • 3) Cancel installation
  • >1
  • info: profile set to 'default'
  • info: setting default host triple to x86_64-pc-windows-gnu
  • info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
  • info: latest update on 2025-03-18, rust version 1.85.1 (4eb161250 2025-03-15)
  • info: downloading component 'cargo'
  • 10.8 MiB / 10.8 MiB (100 %) 3.2 MiB/s in 3s
  • info: downloading component 'clippy'
  • 4.4 MiB / 4.4 MiB (100 %) 2.7 MiB/s in 2s
  • info: downloading component 'rust-docs'
  • 16.8 MiB / 16.8 MiB (100 %) 3.3 MiB/s in 6s
  • info: downloading component 'rust-mingw'
  • 5.2 MiB / 5.2 MiB (100 %) 2.7 MiB/s in 2s
  • info: downloading component 'rust-std'
  • 27.3 MiB / 27.3 MiB (100 %) 3.4 MiB/s in 9s
  • info: downloading component 'rustc'
  • 84.7 MiB / 84.7 MiB (100 %) 3.4 MiB/s in 26s
  • info: downloading component 'rustfmt'
  • 3.4 MiB / 3.4 MiB (100 %) 1007.3 KiB/s in 2s
  • info: installing component 'cargo'
  • info: installing component 'clippy'
  • info: installing component 'rust-docs'
  • 16.8 MiB / 16.8 MiB (100 %) 3.6 MiB/s in 2s
  • info: installing component 'rust-mingw'
  • info: installing component 'rust-std'
  • 27.3 MiB / 27.3 MiB (100 %) 18.7 MiB/s in 1s
  • info: installing component 'rustc'
  • 84.7 MiB / 84.7 MiB (100 %) 19.4 MiB/s in 4s
  • info: installing component 'rustfmt'
  • info: default toolchain set to 'stable-x86_64-pc-windows-gnu'
  • stable-x86_64-pc-windows-gnu installed - rustc 1.85.1 (4eb161250 2025-03-15)
  • Rust is installed now. Great!
  • To get started you may need to restart your current shell.
  • This would reload its PATH environment variable to include
  • Cargo's bin directory (D:\rust\cargo_home\bin).
  • Press the Enter key to continue.

安装完成后 查看基本信息、版本信息

 

安装前如果不想使用mingw64  或不想安装完整的vs   可以去下载msvc  c++ 生成工具[vs_build_tool.exe]
下载运行后,勾选c++工具  

 

右侧的安装固件有点多 可以去掉cmake ; cmake【

链接已隐藏,如需查看请登录或者注册
】 可以自己下载解压缩 并配置到环境变量中

接着在语言处选择加上英文,修改文件安装位置,

 

这个配置ok之后 再从2.1 开始按装rust , 基本上可以一路回车安装了

最新回复

谢谢分享,加油,期待更多深度分享。   详情 回复 发表于 5 天前
点赞(1) 关注
 
 

回复
举报

7032

帖子

0

TA的资源

五彩晶圆(高级)

沙发
 

安装搭建配置讲的很细很详了

 
 
 

回复

7793

帖子

2

TA的资源

五彩晶圆(高级)

板凳
 

谢谢分享,加油,期待更多深度分享。

个人签名

默认摸鱼,再摸鱼。2022、9、28

 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条
有奖直播:当AI遇见仿真,会有什么样的电子行业革新之路?
首场直播:Simcenter AI 赋能电子行业研发创新
直播时间:04月15日14:00-14:50

查看 »

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网 12

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表