ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

win10安装Rust+VS Code配置Rust环境

2022-01-20 13:36:05  阅读:378  来源: 互联网

标签:code Code rustup vs VS Rust world rust


目录

  • 笔记日期:2022年1月20日
  • Rust版本:1.58.0

Rust Playground(在线IDE):https://play.rust-lang.org/

下载rustup

进入:https://www.rust-lang.org/tools/install

点击“DOWNLOAD RUSTUP-INIT.EXE(64-BIT)”下载rustup并安装。默认安装会帮助我们安装:

  • stable-x86_64-pc-windows-msvc
  • cargo
  • clippy
  • rust-docs
  • rust-std
  • rustc
  • rustfmt

下载vs code

进入:https://code.visualstudio.com/

点击“Download for Windows”下载vs code并安装。

vs code配置

vs code中安装如下扩展:

  • rust-analyzer
  • CodeLLDB

常见问题

cargo run时报错:

PS D:\projects\hello_world> cargo run
   Compiling hello_world v0.1.0 (D:\projects\hello_world)
error: linker `link.exe` not found
  |
  = note: program not found

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option

error: could not compile `hello_world` due to previous error

解决办法:在终端依次运行如下两条指令:

rustup toolchain install stable-x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnu

标签:code,Code,rustup,vs,VS,Rust,world,rust
来源: https://www.cnblogs.com/yuyoubei/p/15825971.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有