rust了解
rust了解
据说和C++一样快,但更安全
官网:https://www.rust-lang.org
官方文档: https://doc.rust-lang.org/book
中文社区对官方文档的翻译: https://kaisery.github.io/trpl-zh-cn
安装方式去官网找一些,针对不同平台介绍的比较清楚
不要用这种 sudo apt install cargo
的方式,会有问题
安装后可使用 rustc --version
确认是否安装成功
安装后可以在本地查看入门文档: rustup doc --book
也可以通过例子来学习Rust: https://doc.rust-lang.org/rust-by-example/
如果觉得学会了可以装这个试试改错(建议linux): https://github.com/rust-lang/rustlings
编译器:rustc
自动格式化工具:rustfmt
构建工具和包管理器:cargo
hello world例子
hello.rs
fn main() {
println!("Hello, world!");
}
编译: rustc hello.rs
, 执行即可生成可执行文件
64位windows编译32位程序
# 查看支持生成的目标列表
rustc --print target-list
# 安装编译需要的工具
rustup target add i686-pc-windows-msvc
# 生成一个初始项目,默认会生成src/main.rs, 写了helloworld
cargo new hello
# 进入相关文件夹
cd hello
# 指定目标平台进行编译
cargo build --target=i686-pc-windows-msvc
原链接: https://www.reddit.com/r/rust/comments/78vpxg/help_cross_compiling_for_32_bit_on_windows/
20201123
有些东西,分享就好
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律