PaulJuliusMartinez / jless

jless is a command-line JSON viewer designed for reading, exploring, and searching through JSON data.
https://jless.io
MIT License
4.69k stars 90 forks source link

Can't build on Ubuntu. Says cannot find xcb #87

Open stevecj opened 2 years ago

stevecj commented 2 years ago

When I try to build on Ubuntu (Pop!_OS 21.10) using cargo install jless I get errors trying to find xcb even though I have installed xcb:

   Compiling jless v0.8.0
error: linking with `cc` failed: exit status: 1

  = note: /usr/bin/ld: cannot find -lxcb
          /usr/bin/ld: cannot find -lxcb-render
          /usr/bin/ld: cannot find -lxcb-shape
          /usr/bin/ld: cannot find -lxcb-xfixes
          collect2: error: ld returned 1 exit status

error: failed to compile `jless v0.8.0`, intermediate artifacts can be found at `/tmp/cargo-installVV4yOw`

Caused by:
  could not compile `jless` due to previous error

The xcb lib files that I have:

stevejorgensen@stevej76:~$ ls /usr/lib/x86_64-linux-gnu/libxcb*
/usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0             /usr/lib/x86_64-linux-gnu/libxcb-shape.so.0
/usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0.0.0         /usr/lib/x86_64-linux-gnu/libxcb-shape.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0             /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0
/usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0.0.0         /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxcb-glx.so.0              /usr/lib/x86_64-linux-gnu/libxcb.so.1
/usr/lib/x86_64-linux-gnu/libxcb-glx.so.0.0.0          /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
/usr/lib/x86_64-linux-gnu/libxcb-icccm.so.4            /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1
/usr/lib/x86_64-linux-gnu/libxcb-icccm.so.4.0.0        /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1.0.0
/usr/lib/x86_64-linux-gnu/libxcb-image.so.0            /usr/lib/x86_64-linux-gnu/libxcb-util.so.1
/usr/lib/x86_64-linux-gnu/libxcb-image.so.0.0.0        /usr/lib/x86_64-linux-gnu/libxcb-util.so.1.0.0
/usr/lib/x86_64-linux-gnu/libxcb-keysyms.so.1          /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0
/usr/lib/x86_64-linux-gnu/libxcb-keysyms.so.1.0.0      /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxcb-present.so.0          /usr/lib/x86_64-linux-gnu/libxcb-xinerama.so.0
/usr/lib/x86_64-linux-gnu/libxcb-present.so.0.0.0      /usr/lib/x86_64-linux-gnu/libxcb-xinerama.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxcb-randr.so.0            /usr/lib/x86_64-linux-gnu/libxcb-xinput.so.0
/usr/lib/x86_64-linux-gnu/libxcb-randr.so.0.1.0        /usr/lib/x86_64-linux-gnu/libxcb-xinput.so.0.1.0
/usr/lib/x86_64-linux-gnu/libxcb-render.so.0           /usr/lib/x86_64-linux-gnu/libxcb-xkb.so.1
/usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0       /usr/lib/x86_64-linux-gnu/libxcb-xkb.so.1.0.0
/usr/lib/x86_64-linux-gnu/libxcb-render-util.so.0      /usr/lib/x86_64-linux-gnu/libxcb-xtest.so.0
/usr/lib/x86_64-linux-gnu/libxcb-render-util.so.0.0.0  /usr/lib/x86_64-linux-gnu/libxcb-xtest.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxcb-res.so.0              /usr/lib/x86_64-linux-gnu/libxcb-xv.so.0
/usr/lib/x86_64-linux-gnu/libxcb-res.so.0.0.0          /usr/lib/x86_64-linux-gnu/libxcb-xv.so.0.0.0
amagee commented 2 years ago

I was able to solve this problem with sudo apt install librust-xcb+debug-all-dev

stevecj commented 2 years ago

Thanks, @amagee . I'll try that.

akosma commented 1 year ago

Fedora 38 users might want to sudo dnf install libxcb-devel-1.13.1-11.fc38 to solve this issue.

ojob commented 1 year ago

Hi, same issue with Xubuntu 23.04:

= note: /usr/bin/ld: cannot find -lxcb-xfixes: No such file or directory
        /usr/bin/ld: cannot find -lxcb-shape: No such file or directory

After installation of libxcb-xfixes0-dev and libxcb-shape0-dev, the command cargo install jless works :smiley:

Hope this helps!

Ellipse0934 commented 11 months ago

To add to akosma's comment. On fedora I didn't have luck with his particular package version. However, other can definitely try dnf search libxcb. I installed the following and it works for me.

libxcb.x86_64
libxcb-devel.x86_64
rust-x11rb+dl-libxcb-devel.noarch
xcb-util.x86_64

However, I still think it's an unresolved issue as the dependency could be optional. IIUC libxcb is used for X11 binding which in turn is used for clipboard options. This software should still be functional without clipbboard access.

gilbert-fernandes commented 11 months ago

Same on Fedora 38. Solved by doing this before running the cargo install command :

sudo dnf install rust-xcb+default-devel