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

Linking error cannot find -lxdo when trying to compile 0.0.12 on Linux #55

Closed
8176135 opened this issue Jun 29, 2018 · 18 comments
Closed

Comments

@8176135
Copy link
Contributor

8176135 commented Jun 29, 2018

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 reason note: /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?

@jD91mZM2
Copy link
Contributor

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 xdotool :)

@8176135
Copy link
Contributor Author

8176135 commented Jun 29, 2018

Ah, thank you, installed xdo before, not xdotool.

@8176135 8176135 closed this as completed Jun 29, 2018
bvanrijn added a commit to bvanrijn/image-to-mc that referenced this issue Nov 21, 2018
@jim4067
Copy link

jim4067 commented Jun 22, 2021

Hello 👋
I am still experiencing the same error error: linking with cc failed: exit status: 1
= note: /usr/bin/ld: cannot find -lxdo I do have xdotool installed and do not know what the problem is and any help will be greatly appreciated.

@fynxiu
Copy link

fynxiu commented Apr 25, 2022

@jim4067
I don't know if the message came too late ­🛸
libxdo-dev

@Red-exe-Engineer
Copy link

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 xdotool :)

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

@ninjadev64
Copy link

ninjadev64 commented Apr 9, 2024

Please add this stuff to the README!

@pentamassiv
Copy link
Collaborator

Do you mean something like this: https://github.com/enigo-rs/enigo?tab=readme-ov-file#runtime-dependencies? It's already there, right?

@ninjadev64
Copy link

Oh, completely missed that, sorry!

@pentamassiv
Copy link
Collaborator

No problem, I am glad you find enigo useful and are trying it out :-)

@ninjadev64
Copy link

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.

@pentamassiv
Copy link
Collaborator

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

@ninjadev64
Copy link

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?

@pentamassiv
Copy link
Collaborator

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:

[Text("Hello World! ❤\u{fe0f}"),MoveMouse(10,10,Rel),Scroll(5,Vertical),Button(Left,Click),Key(Unicode('🔥'),Click),Key(Control,Press),Key(Unicode('a'),Click),Key(Control,Release)]

Feel free to ask more, if that was not clear

@ninjadev64
Copy link

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.

@pentamassiv
Copy link
Collaborator

What do you think of this proposal?

@ninjadev64
Copy link

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.

@ninjadev64
Copy link

I ultimately solved it by using revision 390f69d with the x11rb feature activated, but this is a less than ideal solution. I would appreciate the re-addition of the DSL.

@pentamassiv
Copy link
Collaborator

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.

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

7 participants