-
Notifications
You must be signed in to change notification settings - Fork 116
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
Linking error cannot find -lxdo
when trying to compile 0.0.12 on Linux
#55
Comments
It now uses libxdo instead of X11 directly so we can use a well-known and therefore less buggy backend. To fix the linking error, install |
Ah, thank you, installed xdo before, not xdotool. |
Hello 👋 |
@jim4067 |
Thank you so much! I recently reinstalled Arch Linux and a Rust program I wrote was giving a huge error when I tried to compile it. :D |
|
Do you mean something like this: https://github.com/enigo-rs/enigo?tab=readme-ov-file#runtime-dependencies? It's already there, right? |
Oh, completely missed that, sorry! |
No problem, I am glad you find enigo useful and are trying it out :-) |
Me again! I've switched to openSUSE Tumbleweed since my comment and am unable to find the libxdo package. I have libX11-devel, xdo, and xdotool installed, and none work. |
You can try activating the x11rb feature. If you do that, you won't need to install any dependencies. There might still be some bugs, that is why it is not the default yet. Please open an issue if you encounter a bug when enabling the feature |
Hi, it links successfully if I enable this feature. However, this feature is only available in 0.2.0 to my understanding, but I depend on the existence of the DSL as my project relies on the user being able to easily create macros by providing input to a text box. Is there an easy way to obtain DSL-like functionality in v0.2.0? |
Yes, that should be no problem. Have a look at the serde example. You can just do the part that start with line 28. There no longer is a DSL because implementing it is much more complex and time consuming than using serde. It is also more flexible, because you can chose from whatever format serde can deserialize. In the example, ron is used. In the example, a few tokens are serialized and the resulting string is printed in the terminal. This should give you an idea on what users would have to enter into your text box. For your convenience, here is the tokens that are getting serialized: let tokens = vec![
Token::Text("Hello World! ❤️".to_string()),
Token::MoveMouse(10, 10, enigo::Coordinate::Rel),
Token::Scroll(5, enigo::Axis::Vertical),
Token::Button(Button::Left, enigo::Direction::Click),
Token::Key(Key::Unicode('🔥'), enigo::Direction::Click),
Token::Key(Key::Control, enigo::Direction::Press),
Token::Key(Key::Unicode('a'), enigo::Direction::Click),
Token::Key(Key::Control, enigo::Direction::Release),
]; and this is what the resulting string looks like:
Feel free to ask more, if that was not clear |
Hi, yep, I'm aware of the serde features, but inputting macros in RON/JSON/whatever would be quite cumbersome for users, as opposed to the comparatively simple DSL. |
What do you think of this proposal? |
It's better, but still not great. I could implement a custom deserialiser and publish to crates.io when I have time in a few weeks. |
I ultimately solved it by using revision |
I am not going to add the DSL again. It was a lot of code and very error prone. Each new key had to get added to it and it was incomplete because it is quite difficult to write. I have created a new PR for you to make the strings to deserialize from even less verbose #283. There is also the serde(untagged) attribute. That would make it even more concise, but there have been errors that I wasn't able to resolve in a timely manner. If you could get that to work, I'd merge it. I'd advise against staying on an old commit. There are still a few bugs left that I'll fix in the coming months. |
After upgrading to 0.0.12 from 0.0.11, when I try to compile on Linux (works fine on gnu Windows) it gives
error: linking with `cc` failed: exit code: 1
and the reasonnote: /usr/bin/ld: cannot find -lxdo
The only change to dependencies in 0.0.12 that seem to affect linux is
objc 0.2.2
, but when I tried to compile that by itself, it compiled just fine.I also installed xdo, but that didn't seem to change anything.
Any ideas?
The text was updated successfully, but these errors were encountered: