DEV Community

Cover image for Solving Rustc 'cannot find -lxcb-shape'
Amber 🏳️‍🌈
Amber 🏳️‍🌈

Posted on

Solving Rustc 'cannot find -lxcb-shape'

I wanted to learn Amethyst, a pretty cool game engine made in Rust. But when I tried to compile the "Hello World" project, I got the error cannot find -lxcb-shape. This led to a few wasted hours and a lot of headaches, so I thought I'd share the fix here.

I first tried to just run apt get install libxcb-shape. It didn't exist. I thought this meant that the package wasn't in the Debian package list, but I was wrong.

Then I tried just googling my exact issue, but I gave up quick. I should have kept going, because my answer was there, but whatever.

I then moved to figuring out what lxcb was, and apparently it's some sort of X window system.. thing. I'm still not really sure what it does.

I found their GitLab page, and decided to try and compile and install it myself. There were a couple of dependencies I had to compile and install first, but eventually I got it installed.

It didn't work. All of those hours were a waste.

I went back to googling my exact issue, as I mentioned earlier, and found something. There was a stackoverflow thread that mentioned the exact same problem.

I should have read the entire stackoverflow thread, but I just went comment by comment until I found this, a package listing for Ubuntu. It had the incredibly memorable and useful name of libxcb-shape0-dev. Why there is a 0 there, I have no idea. There is probably a good reason, but I don't know it, so it annoyed me.

I installed that specific library, and it worked! My amethyst example was compiling! But there's something else.

I was gonna end it here, but then, writing this article, I went and checked that stackoverflow thread again, and one person had linked the README for the amethyst project. There was a list of dependencies that I hadn't installed. This whole thing was just me being an idiot and not reading. I have never channeled Druaga1 more than in this moment.

So, moral of the story, check the dependencies of things you install before going down a rabbit hole of self-compiling random libraries you now have no way of easily removing, so they'll just stay there.

Thank you for reading about this mess.

Top comments (4)

Collapse
 
birkskyum profile image
Birk Skyum

Thank you so much. Had same issue with lxcb-xfixes which I eventually found as libxcb-xfixes0-dev

Collapse
 
zakariachahboun profile image
zakaria chahboun

Thanks to you too!

Collapse
 
zakariachahboun profile image
zakaria chahboun

Thanks!

Collapse
 
jamiesaker profile image
Jamie Saker

Thank you so much for this as it helped me get alacritty shell compiled on Kali Linux.