Rust cross compilation: compile 32-bit Rust library on Windows 10 64-bit system

1. Add x86 compiler linker

 rustup target add i686-pc-windows-msvc

If there is no corresponding x86 compilation environment, execute the x86 compilation command, there will be an error that the crate cannot be found in the screenshot

2. Compile the x86 version library

Continue to use  C# to call  the project code in the Rust library, and compile the x86 version of the library

input the command 

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

 

 PS: If you execute rustup target add i686-pc-windows-msvc and still get an error, you need to manually configure the corresponding linker path, refer to https://dev-tang.com/post/2020/01/cross-compilation. html

Guess you like

Origin blog.csdn.net/qq1326702940/article/details/124193868
Recommended