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

猜你喜欢

转载自blog.csdn.net/qq1326702940/article/details/124193868
今日推荐