Rust 编译windows 应用添加ICON
Cargo.toml
[package] build = "build.rs" [build-dependencies] embed-resource = "1.7.2"
build.rs 与 Cargo.toml同级
extern crate embed_resource;
fn main() {
embed_resource::compile("./icon.rc");
}
准备一个icon图标
打开记事本写入icon配置生成一个rc文件内容如下:
name ICON "icon.ico"
name为icon名可以自定义 icon路径对应你真实的ico路径