Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't cross compile from linux to win32 #105

Closed
AndreiTS opened this issue Mar 25, 2021 · 8 comments
Closed

Can't cross compile from linux to win32 #105

AndreiTS opened this issue Mar 25, 2021 · 8 comments

Comments

@AndreiTS
Copy link

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
Copy link
Owner

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

@AndreiTS
Copy link
Author

AndreiTS commented Mar 25, 2021

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
Copy link
Owner

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
Copy link
Collaborator

jairinhohw commented Apr 1, 2021

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
Copy link
Author

AndreiTS commented Apr 1, 2021

using cross solve it, thanks

@AndreiTS AndreiTS closed this as completed Apr 1, 2021
@AndreiTS
Copy link
Author

AndreiTS commented Apr 1, 2021

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

@jairinhohw
Copy link
Collaborator

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
Copy link
Author

AndreiTS commented Apr 2, 2021

Both machines are 64bits, using cross

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants