12

I'm trying to build Qt5 on Debian Wheezy. I run the configure script:

./configure -developer-build -opensource -nomake examples -nomake tests

But it fails with this error:

Running configuration tests...
The test for linking against libxcb and support libraries failed!
 You might need to install dependency packages, or pass -qt-xcb.
 See src/plugins/platforms/xcb/README.

I get this error even though libxcb1-dev has already been installed.

There is a similar question, you can look at it for reference - Qt5 install on OSX -qt-xcb, but it is about OS X, and the suggested solutions there won't work for Linux I think.

Is there a way to enable XCB, or should I just pass -qt-xcb as suggested in the error message? Would the build be missing any vital features then?

Community
  • 1
  • 1
sashoalm
  • 75,001
  • 122
  • 434
  • 781

4 Answers4

25

The page Qt for X11 Requirements lists some packages required to build Qt on Debian.

The README mentioned in the error message also lists packages for Ubuntu and Fedora, so check one of those two places if the following dependencies don't help.

Alternatively you could try the "-qt-xcb" flag as it suggests. According to the above page this just builds some libraries in instead of linking against the system libraries.

Debian:

libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev

Ubuntu:

libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-glx0-dev

Fedora

libxcb libxcb-devel libXrender libXrender-devel xcb-util-wm xcb-util-wm-devel xcb-util xcb-util-devel xcb-util-image xcb-util-image-devel xcb-util-keysyms xcb-util-keysyms-devel

Alex Huszagh
  • 13,272
  • 3
  • 39
  • 67
Miss Blit
  • 471
  • 6
  • 10
  • 2
    The above link is broken now, here is working one: http://doc.qt.io/qt-5/linux-requirements.html – Bogolt Apr 06 '16 at 06:27
  • To complete Miss Blit answers on ubuntu 20.04 with Qt5.15 you need as well libxcb-util-dev – idleroamer 3 hours ago – sashoalm Jun 29 '21 at 10:41
7

This is actually just my experience with the same problem in Ubuntu. The libraries as given by Miss Blit are correct, except from libxcb-sync0 libxcb-sync0-dev, these should be libxcb-sync1 libxcb-sync-dev. I have Ubuntu 14.10

Regards,

Anas
  • 263
  • 3
  • 11
5

Try to install these libraries for my fix the issue on ubuntu 16.4.

sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev
Softmixt
  • 1,658
  • 20
  • 20
  • 1
    I agree that the poster should have put in how it fixes the issue, but in fact this answer is the only one that provided the exact command I needed to run to solve the problem. Maybe this answer should be merged with the accepted one. – Guy Starbuck Dec 21 '17 at 19:55
1

My OS is centos7. After I installed libX11* libxcb* packages, I still get the problem:

The test for linking against libxcb and support libraries failed

$ cat qtbase/src/plugins/platforms/xcb/README

On Fedora, the following packages are required:

libxcb libxcb-devel libXrender libXrender-devel xcb-util-wm xcb-util-wm-devel xcb-util xcb-util-devel xcb-util-image xcb-util-image-devel xcb-util-keysyms xcb-util-keysyms-devel

The libraries about xcb* are missing, I install packages using yum install xcb* to solve problem.

aboger
  • 2,214
  • 6
  • 33
  • 47
green new
  • 11
  • 2