-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Crate breaks with different build targets #21
Comments
https://github.com/Lokathor/rusty-xinput/blob/master/src/lib.rs#L28 This line here is what makes the whole module be effectively blank when not on windows. Normally, I'd say we can just add a cargo feature to allow the crate to build more places if another crate provides a compatible interface, but I think that the The docs at https://docs.rs/ev3dev-lang-rust don't seem to show the base windows definitions, how are you getting them on linux? |
First of all thank you for your help I greatly appreciate it. The ev3dev-lang-rust crate relies on you using your brick with the ev3dev Linux distro installed. This means you cannot use the crate without configuring your build target to the Linux musleabi toolchain. Essentially to my understanding it just doesn't have Windows bindings. I have attempted to use the crate without a configured build target but it just produces similar issues the the one found here. I will look into the winapi crate and see if there is any way to make this work on Linux. If not then I will have a look at some other XInput handlers as I know of at least one in a different language to Rust which is built for Linux. Thanks again for your help |
I have looked into winapi and it doesn't appear to be at all compatible with Linux not altogether shockingly. I am using this https://github.com/kozec/dumbxinputemu for an XInput dll on Linux and am now trying to port over some of the functionality used for windows onto Linux. |
If you just provide all the defines that rusty-xinput imports the rest should "just work" in terms of those definitions, though since they could theoretically vary by target and your "use xinput on linux" situation sounds rather unusual there could be some unexpected problem. If you figure it out and get it working I'd be happy to try and integrate it back into this crate. Without your special linux device I'm bot sure how much help i can provide from my end though. |
When you say provide all the defines do you mean just define them eg for XInputHandle just something like #[cfg(not(windows))]
#[derive(clone)]
pub struct XInputHandle {} And thank you so much for your help. |
I was thinking more like a |
Ahh ok I didn't think of that I will try have a look at both, thank you again |
I am attempting to write some code to control a robot in Rust using the EV3 brick and with ev3dev-lang-rust. I want to use and Xbox Controller to control it and have used this crate for Xbox control before. To use the ev3dev crate for rust you are required to use a linux musleabi toolchain which I have found a compatible dll for but the crate breaks with that build target. I attempt to call rusty_xinput::XInputHandle for my handler but the compiler tells me that it cannot find XInputHandle in rusty_xinput.
Would there be any way to make this crate work with different build targets or would I need to create me own interface with the dll or find a different crate? Thank you for the amazing crate and thanks for any help in advance!
The text was updated successfully, but these errors were encountered: