fernandobatels / rsfbclient

Rust Firebird Client
MIT License
74 stars 10 forks source link

Can't cross compile from linux to win32 #105

Closed AndreiTS closed 3 years ago

AndreiTS commented 3 years ago

I'm trying to create a win32 dll, I'm running: cargo build --target=x86_64-pc-windows-gnu --release

and getting this error: note: /usr/bin/x86_64-w64-mingw32-ld: cannot find -lfbclient

cargo.toml: image

lib.rs: image

fernandobatels commented 3 years ago

Please, try without default crate features: rsfbclient = { version="0.16.0", features = ["pure_rust"], default-features = false }

AndreiTS commented 3 years ago

Sorry, I said the wrong command, actually it is: cargo build --target=i686-pc-windows-gnu --release

I tried to build in a windows virtual machine to 32bits using platform i686-pc-windows-msvc but it's not working either.

Log from linux: https://pastebin.com/V0KfpCc0

fernandobatels commented 3 years ago

I tried compile one o examples here, with i686-pc-windows-gnu, and got the same error. Unfortunately, my experience with cross compile is very superficial.

You can help @jairinhohw ?

jairinhohw commented 3 years ago

Are you sure you disabled the default features of the rsfbclient crate? It should compile just fine with only the pure_rust feature.

Edit: You may want to try using the cross tool, maybe it can resolve the issue

AndreiTS commented 3 years ago

using cross solve it, thanks

AndreiTS commented 3 years ago

It's working on a computer but in the other it still don't work: image But I can work with that.

jairinhohw commented 3 years ago

Witch computer is the one that does not work? 32 or 64 bits? Are you using the cross tool?

Maybe it is related to this issue, so it may just be unreliable to cross compile from a x64 (64bits) machine to a x86 (32bits).

AndreiTS commented 3 years ago

Both machines are 64bits, using cross