0
点赞
收藏
分享

微信扫一扫

Rust 交叉编译:在Windows 10 64位系统编译 32位的Rust 库

1. 添加 x86编译链接器

 rustup target add i686-pc-windows-msvc

如果没有相应的 x86 编译环境,执行x86的编译命令 ,会有截图找不到crate的错误

2. 编译x86版本库

继续沿用 C# 调用 Rust 库 文中的项目代码,编译出x86 版本的库

输入命令 

cargo build --release --target i686-pc-windows-msvc

 

 PS:如果执行了 rustup target add i686-pc-windows-msvc,还会报错,则需要手动配置对应链接器路径,参考https://dev-tang.com/post/2020/01/cross-compilation.html

举报

相关推荐

0 条评论