slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.59k stars 604 forks source link

Document dependencies required for developing Rust and C++ apps with Slint on macOS, Windows, and Linux (X11/Wayland/KMS) #1234

Open abdmh opened 2 years ago

abdmh commented 2 years ago

We should document the libraries / packages required to develop with Slint (macOS/Windows/Linux). This needs to be included in the C++ and Rust documentation. For Node.js this belongs into a section about building from source.

We should cover package names for the most popular Linux distributions.

Relevant in this context is also the existing documentation about supported platforms:

https://slint.dev/releases/1.3.2/docs/slint/src/introduction/supported_platforms

Perhaps it would make sense to document the dependencies in scope of this ticket in the same place and link to it from Rust/C++/Node.js.

Original:

  = note: /usr/bin/ld: cannot find -lxcb-render: No such file or directory
          /usr/bin/ld: cannot find -lxcb-shape: No such file or directory
          /usr/bin/ld: cannot find -lxcb-xfixes: No such file or directory
          collect2: error: ld returned 1 exit status
abdmh commented 2 years ago

$ apt search libxcb | grep installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libpthread-stubs0-dev/jammy,now 0.4-1build2 amd64 [installed,automatic] libxcb-dri2-0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-dri3-0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-glx0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-icccm4/jammy,now 0.4.1-1.1build2 amd64 [installed,automatic] libxcb-image0/jammy,now 0.4.0-2 amd64 [installed,automatic] libxcb-keysyms1/jammy,now 0.4.0-1build3 amd64 [installed,automatic] libxcb-present0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-randr0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-render-util0/jammy,now 0.3.9-1build3 amd64 [installed,automatic] libxcb-render0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-res0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-shape0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-shm0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-sync1/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-util1/jammy,now 0.4.0-1build2 amd64 [installed,automatic] libxcb-xfixes0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-xinerama0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-xinput0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-xkb1/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb-xv0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb1/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] libxcb1-dev/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]

$ apt search libxcb-render Sorting... Done Full Text Search... Done libxcb-render-util0/jammy,now 0.3.9-1build3 amd64 [installed,automatic] utility libraries for X C Binding -- render-util

libxcb-render-util0-dev/jammy 0.3.9-1build3 amd64 utility libraries for X C Binding -- render-util

libxcb-render0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic] X C Binding, render extension

libxcb-render0-dev/jammy 1.14-3ubuntu3 amd64 X C Binding, render extension, development files

ogoffart commented 2 years ago

I guess this is because of the winit crate.

On the CI we do install (with an older Ubuntu version, but i'd expect it to be similar in newer ubuntu)

apt-get install libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev
abdmh commented 2 years ago

Thanks, this indeed SOLVED the issue.

apt-get install libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev

ogoffart commented 2 years ago

I guess we should document that better

hunger commented 9 months ago

docs/building.md has all the dependencies, but it is not part of the generated docs. It is linked to from developer-visible places.