[Development] Is Xlib a hard requirement for Qt5 xcb?

Nicolás Alvarez nicolas.alvarez at gmail.com
Fri Jul 26 23:19:26 CEST 2013

Hi everyone,

I attempted to build Qt5 and KF5 in a minimal system, only installing
dependencies when configure/cmake asks for them, in order to find bugs
(such as missing dependency checks) in the build system. I was
successful, in the sense that I found missing checks :)

I'm configuring Qt with the options suggested in the KF5 wiki:
    ./configure -prefix $PWD/qtbase -opensource -developer-build
-nomake tests -nomake examples -dbus -no-separate-debug-info -xcb -qpa
xcb -no-gtkstyle -no-pch

My minimal system does not have X11 development files (such as
Xlib.h), but it does have XCB stuff.

Compilation fails with:
make[2]: Entering directory `/home/nicolas/src/qt5/qtbase/src/widgets'
util/qsystemtrayicon_x11.cpp:60:22: fatal error: X11/Xlib.h: No such
file or directory
make[2]: Leaving directory `/home/nicolas/src/qt5/qtbase/src/widgets'

make[5]: Entering directory
qxcbmime.cpp:49:23: fatal error: X11/Xutil.h: No such file or directory
qxcbcursor.cpp:52:28: fatal error: X11/cursorfont.h: No such file or directory
qxcbxsettings.cpp:46:36: fatal error: X11/extensions/XIproto.h: No
such file or directory
make[5]: Leaving directory

The question is: is Qt5/XCB *supposed* to work without Xlib? I got the
feeling that there was some attempt to make it work, since some code
is protected with #ifdef XCB_USE_XLIB checks (though perhaps that
define is for something else?). If supposed to work, then it's
currently broken and likely needs some more ifdefs. If not supposed to
work, then the configure script should abort Xlib isn't present while
configuring for XCB. I'm interested in fixing it either way, but I
can't take the decision of what's supported :)


More information about the Development mailing list