linuxubunturustlinker-errorsrust-cargo

How to fix "cannot find -lxcb" error during cargo install?


I'm getting an error when installing a program via Cargo:

ld: cannot find -lxcb: No such file or directory

I seem to be lacking libraries. I'm on Ubuntu 22.04. How could I solve it?


Solution

  • Having a similar error message while trying to cargo install jless on Xubuntu 23.04, the info you may need is that lxcb is named libxcb in the package manager.

    The error message I had:

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

    What I did:

    sudo apt install libxcb-xfixes0-dev
    

    Hope this helps!