Qt for X11 Requirements

Platform Plugin Dependencies

在 Linux 上, 使用 xcb QPA (Qt Platform Abstraction) 平台插件. 它提供了 Qt GUIQt Widgets 在 X11 上运行所需的基本功能. 下表描述了其库依赖关系. 要从源代码构建 Qt, 你还需要为你的系统安装这些库的开发包.

注意: 从 Qt 5.15开始, Qt 要求 libxcb 1.11. 此外, 删除了捆绑下面一些库的 -qt-xcb 配置选项. 无论如何, 你现在可以使用 -bundled-xcb-xinput 配置, 以避免对系统 xcb-xinput 的依赖.

NameLibraryNotesConfiguration optionsMinimum working version
XRenderlibXrenderX Rendering Extension; used for anti-aliasing and alpha cursor support-xrender or auto-detected0.9.0
xcb-renderlibxcb-renderX C Bindings for Render extensionauto-detected or provided by -qt-xcb1.8.1
xcb-render-utillibxcb-render-utilUtility library for XCB for Render extensionauto-detected or provided by -qt-xcb0.3.8
xcb-shapelibxcb-shapeX C Bindings for Shape extensionauto-detected or provided by -qt-xcb1.8.1
xcb-randrlibxcb-randrX C Bindings for Resize and Rotate Extensionauto-detected or provided by -qt-xcb1.8.1
xcb-xfixeslibxcb-xfixesX C Bindings for Fixes Extensionauto-detected or provided by -qt-xcb1.8.1
xcb-synclibxcb-syncX C Bindings for Sync Extensionauto-detected or provided by -qt-xcb1.8.1
xcb-shmlibxcb-shmX C Bindings for Shared Memory Extensionauto-detected or provided by -qt-xcb1.8.1
xcb-icccmlibxcb-icccmX C Bindings for ICCCM Protocolauto-detected or provided by -qt-xcb0.3.9
xcb-keysymslibxcb-keysymsUtility library for XCB for keycode conversionauto-detected or provided by -qt-xcb0.3.9
xcb-imagelibxcb-imageUtility library for XCB for XImage and XShmImage, used for QBackingStore and cursor supportauto-detected or provided by -qt-xcb0.3.9
FontconfiglibfontconfigFont customization and configuration-fontconfig or auto-detected2.1
FreeTypelibfreetypeFont engine2.1.3
XilibXiX11 Input Extensions-xinput or auto-detected1.3.0
XextlibXextX Extensions6.4.3
X11libX11X11 client-side library6.2.1
xcblibxcbX C Binding library1.8.1
X11-xcblibX11-xcbXlib/XCB interface library1.3.2
SMlibSMX Session Management-sm or auto-detected6.0.4
ICElibICEInter-Client Exchange-sm or auto-detected6.3.5
gliblibglib-2.0Common event loop handling-glib or auto-detected2.8.3
pthreadlibpthreadMultithreading2.3.5

这些库的开发包包含从源代码构建 Qt 时使用的头文件. 例如, 在基于 Debian 的 GNU/Linux 系统上, 我们建议你安装以下开发包:

  • 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

其中一些软件包依赖于此列表中的其他软件包, 因此安装一个软件包可能导致自动安装其他软件包. 其他发行版可能提供具有相似名称的系统包.

OpenGL Dependencies

Configure attempts to automatically detect OpenGL ES 2.0, or later, or regular desktop OpenGL. You can disable OpenGL support by using the -no-opengl option.

Note: The Qt OpenGL module (which contains classes that start with QGL) has been deprecated in favor of the Qt GUI module (which contains classes that start with QOpenGL).

Multimedia Dependencies

As described in the Multimedia overview, Qt Multimedia uses the GStreamer multimedia framework as the backend for audio and video playback on Linux. The minimum required version of GStreamer is 0.10.24. The 1.x series is also supported.

To build Qt Multimedia, you need the GStreamer library, base plugins, and development files for your system. To run applications that use Qt Multimedia, you might also need to install the following GStreamer plugins: 'good', 'ugly', 'bad', ffmpeg (0.10), and libav (1.x). These additional plugins contain various codecs for audio and video decoding, as well as the necessary components for using the camera APIs. The package names for GStreamer vary between Linux distributions; try searching for gstreamer or libgstreamer in your distribution's package repository to find suitable packages.

Qt WebEngine Dependencies

Qt WebEngine has additional build requirements which are listed in the Qt WebEngine Platform Notes.