DioxusLabs / dioxus

Fullstack app framework for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
20.39k stars 783 forks source link

Error compiling desktop project on linux (`linking with 'cc' failed`) #2015

Closed jonnyandrew closed 6 months ago

jonnyandrew commented 6 months ago

Problem

Error compiling a desktop app on Ubuntu Linux:

error: linking with `cc` failed: exit status: 1

Steps To Reproduce

Note that I already followed the desktop getting started guide to

Expected behavior

Sample project compiles and runs.

Screenshots

N/A

Environment:

Questionnaire

ealmloff commented 6 months ago

Does the error you get with cargo run have any more information than linking with `cc` failed: exit status: 1? Generally link errors will have more specific information about what part of linking fails.

Tahinli commented 6 months ago

sudo apt install gcc-multilib

this may fix.

jonnyandrew commented 6 months ago

Does the error you get with cargo run have any more information than linking with `cc` failed: exit status: 1? Generally link errors will have more specific information about what part of linking fails.

Ah sorry, I didn't spot it the first time round:

cannot find -lxdo: No such file or directory

I fixed the problem by installing libxdo-dev :) Thanks for your help!

nully0x commented 6 months ago

to fix on fedora, you should install

sudo dnf install libxdo-devel

bluenote10 commented 6 months ago

It should be noted that this currently leads to a somewhat rough experience for new users: Just checking out the repo and running cargo run --example hello_world results in an intimidating:

image

I'm wondering if the hard dependency on -ldxo is actually intentional, or could it be made optional? Why does running the example depend on linking to an x11 automation tool?

nully0x commented 6 months ago

Yeah, I faced the same issue while following this https://dioxuslabs.com/learn/0.5/getting_started.

I had to also run sudo dnf install perl also to make it build on my machine

0Akise commented 5 months ago

also encountered same issue on Arch Linux, and solved by doing

sudo pacman -S xdotool

it will install libxdo and fixes the issue for Arch :)