当前位置: 首页 > article >正文

error: linker `link.exe` not found

开始学习rust,安装好rust的环境,开始从hello world开始,结果用在win10环境下,使用vs code或cmd窗口编译rust报错:

PS E:\study_codes\rust-demo\chart01> rustc hello.rs
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 Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.

note: VS Code is a different product, and is not sufficient.

error: aborting due to 1 previous error

vs code或cmd窗口中运行以下命令即可解决:

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

运行rust编译命令:

rustc hello.rs
.\hello.exe

生成一个hello.exe文件

运行结果:

hello world

Have fun learning about rust!


http://www.kler.cn/a/503711.html

相关文章:

  • 【C语言】字符串函数详解
  • 【STM32-学习笔记-7-】USART串口通信
  • Unreal Engine 5 (UE5) Metahuman 的头部材质
  • 如何进行父子组件传递属性值及方法调用?
  • 汽车物资拍卖系统架构与功能分析
  • 基于openEuler22.03SP4部署Prometheus+Grafana
  • GitLab本地服务器配置ssh和克隆项目
  • C++----STL(string)
  • ubuntu22安装maven
  • 移动云自研云原生数据库入围国采!
  • uniapp小程序分包路由跳转+二级页面详情跳转保留当前页方法教程
  • c#有什么显示矢量图SVG的控件VB.NET-svg转透明PNG图像
  • 【Varnish】:解决 Varnish 7.6 CDN 静态资源缓存失效问题
  • 神经网络初始化 (init) 介绍
  • 你喜欢用什么编辑器?
  • Java中的动态代理是什么?如何实现?
  • Spark vs Flink分布式数据处理框架的全面对比与应用场景解析
  • P1图文解析:初识算法和数据结构
  • [Deep Learning] Anaconda+CUDA+CuDNN+Pytorch(GPU)环境配置-2025
  • day09_kafka高级