一、错误:error: linker 'link.exe' not found
解决:
1、 install visual studio or build tools:
microsoft c++ 生成工具 - visual studio

选择“使用 c++ 的桌面开发”工作负载,确保安装了以下组件:
- msvc v143 - vs 2022 c++ x64/x86 构建工具
- windows 10 sdk
- c++ cmake 工具(可选)

2、添加目标工具链
> rustup install stable-x86_64-pc-windows-msvc > rustup default stable-x86_64-pc-windows-msvc > cargo clean > cargo build --verbose > cargo run 42 56 //运行程序
二、use std::str::fromstr; unresolved import: `std::str::fromstr` [e0432]


原因未知:
rustrover 2024.3.2 报错
但是编译、运行代码都可以成功, 没有问题
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
发表评论