Qt for Windows - Requirements
Qt for Windows-要求
This page describes the required libraries and environment for Qt for Windows.
本页介绍Qt for Windows所需的库和环境。
Libraries
库
The following third-party libraries may be used when running Qt 5 applications on Windows.
在Windows上运行Qt 5应用程序时,可以使用以下第三方库。
- OpenSSL Toolkit: Qt can make use of OpenSSL to support Secure Socket Layer (SSL) communication.
- OpenSSL工具包:Qt可以利用OpenSSL来支持安全套接字层(SSL)通信。
- ICU: Qt 5 can make use of the ICU library for enhanced UNICODE and Globalization support (see QTextCodec, QCollator::setNumericMode()).
ICU:Qt 5可以利用ICU库来增强UNICODE和全球化支持(请参阅QTextCodec,QCollator::setNumericMode())。
At compile time, the include and lib folders of the ICU installation must be appended to the
INCLUDE
andLIB
environment variables. At run-time, the ICU DLLs need to be found by copying the DLLs to the application folder or by adding the bin folder of the ICU installation to thePATH
environment variable.
在编译时,ICU安装的include和lib文件夹必须附加到INCLUDE
和LIB
环境变量。在运行时,需要通过将DLL复制到应用程序文件夹或将ICU安装的bin文件夹添加到PATH环境变量来找到ICU DLL。 - ANGLE: This library converts OpenGL ES 2.0 API calls to DirectX 11 or DirectX 9 calls (depending on availability), removing the need to install graphics drivers on the target machines.
- ANGLE:此库将OpenGL ES 2.0 API调用转换为DirectX 11或DirectX 9调用(取决于可用性),从而无需在目标计算机上安装图形驱动程序。
SSL
Support for Secure Sockets Layer (SSL) communication is provided by the OpenSSL Toolkit, which must be obtained separately. Download the latest version of the toolkit that is supported by Qt.
OpenSSL工具包提供对安全套接字层(SSL)通信的支持,必须单独获取。下载Qt支持的最新版本的工具包。
Qt can be configured to use OpenSSL in three ways:
Qt可以通过三种方式配置为使用OpenSSL:
- Qt Network loads OpenSSL libraries (DDLs) when first needed, at runtime. If not found, the application continues to run, but fails to handle SSL communication.
Qt Network在运行时首次需要时加载OpenSSL库(DDL)。如果未找到,应用程序将继续运行,但无法处理SSL通信。
All official Qt binary builds use this configuration.
所有官方Qt二进制构建都使用此配置。The OpenSSL libraries are looked up first in the directory of the executable, then in the Windows System directory (usually
C:\Windows\system32
), and finally in all directories listed in thePATH
environment variable.
OpenSSL库首先在可执行文件的目录中查找,然后在Windows系统目录(通常为C:\Windows\system32)中查找,最后在PATH环境变量中列出的所有目录中查找。 - Qt Network links against the OpenSSL libraries. If they cannot be found at load time, the application fails to start.
- Qt网络链接到OpenSSL库。如果在加载时找不到它们,则应用程序无法启动。
- Qt Network compiles against a static version of the OpenSSL libs, and OpenSSL becomes part of the Qt5Network library.
- Qt Network针对OpenSSL库的静态版本进行编译,OpenSSL成为Qt5Network库的一部分。
If you compile Qt yourself, you can configure how Qt uses OpenSSL by setting either the -openssl
/ -openssl-runtime
or -openssl-linked
configure flags.
如果你自己编译Qt,你可以通过设置-OpenSSL/-OpenSSL运行时或-OpenSSL链接的配置标志来配置Qt如何使用OpenSSL。
If OpenSSL is not found in the normal compiler include and library directories, you can set either the OPENSSL_PREFIX
, or OPENSSL_INCDIR
and OPENSSL_LIBDIR
configure arguments. If OPENSSL_PREFIX
is set, OPENSSL_INCDIR
defaults to OPENSSL_PREFIX/include
and OPENSSL_LIBDIR
to OPENSSL_PREFIX/lib
.
如果在正常的编译器include和库目录中找不到OpenSSL,则可以设置OPENSSL_PREFIX
或OPENSSL_INCDIR
和OPENSSL_LIBDIR
配置参数。如果设置了OPENSSL_PREFIX
,则OPENSSL_INCDIR
默认为OPENSSL_PPREFIX/include,OPENSSL_LIBDIR默认为OPENSSL_PREFIX/lib。
The actual libraries to link to can be tweaked by setting the OPENSSL_LIBS
, OPENSSL_LIBS_DEBUG
, and OPENSSL_LIBS_RELEASE
configure arguments.
通过设置OPENSSL_LIBS、OPENSSL_LIBS_DEBUG和OPENSSL_LIBSS_RELEASE配置参数,可以调整要链接的实际库。
- To load OpenSSL at runtime, set the
-openssl-runtime
configure argument. Qt will try to findopenssl/ssl.h
andopenssl/opensslv.h
in the default include path of the compiler. You can specify an additional include directory by settingOPENSSL_INCDIR
.
要在运行时加载OpenSSL,请设置-openssl-runtime
配置参数。Qt将尝试在编译器的默认包含路径中找到openssl/ssl.h和openssl/opensslv.h。您可以通过设置OPENSSL_INCDIR来指定其他包含目录。
For example:
例如:configure -openssl-runtime OPENSSL_INCDIR="C:\Program Files\OpenSSL-Win64\include"
- To link Qt Network against OpenSSL libraries, set the
-openssl-linked
configure argument. Use theOPENSSL_PREFIX
variable to let Qt correctly locate and build against your OpenSSL installation:
要将Qt网络与OpenSSL库链接起来,请设置-openssl-linked
配置参数。使用OPENSSL_PREFIX变量让Qt正确定位并针对OPENSSL安装进行构建:
For example:
例如:configure -openssl-linked OPENSSL_PREFIX="C:\Program Files\OpenSSL-Win64"
- To link Qt Network against a static version of the OpenSSL libs, set the
-openssl-linked
argument, and setOPENSSL_PREFIX
, orOPENSSL_INCDIR
andOPENSSL_LIBDIR
. In addition, you probably need to set theOPENSSL_LIBS
,OPENSSL_LIBS_DEBUG
,OPENSSL_LIBS_RELEASE
configure arguments to let Qt correctly link against your static build of the OpenSSL libraries.
要将Qt网络链接到OpenSSL库的静态版本,请设置-openssl-linked
参数,并设置OPENSSL_PREFIX
,或OPENSSL_INCDIR
和OPENSSL_LIBDIR
。此外,可能需要设置OPENSSL_LIBS、OPENSSL_LIBS_DEBUG、OPENSSL_LIBS_RELEASE配置参数,以便Qt正确链接到OPENSSL库的静态版本。
For example:
例如:set OPENSSL_DIR=C:\Program Files\OpenSSL-Win64 configure -openssl-linked OPENSSL_INCDIR="%OPENSSL_DIR%\include" OPENSSL_LIBDIR="%OPENSSL_DIR%\lib\VC\static" OPENSSL_LIBS="-lWs2_32 -lGdi32 -lAdvapi32 -lCrypt32 -lUser32" OPENSSL_LIBS_DEBUG="-llibssl64MDd -llibcrypto64MDd" OPENSSL_LIBS_RELEASE="-llibssl64MD -llibcrypto64MD"
See Secure Sockets Layer (SSL) Classes for further instructions on Qt with SSL support.
有关支持SSL的Qt的更多说明,请参阅安全套接字层(SSL)类。
ICU
From Qt 5.3 and onwards, configure does not link Qt Core against ICU libraries anymore by default. This reduces the size of a self-contained application package considerably.
从Qt 5.3开始,默认情况下,configure不再将Qt Core与ICU库链接起来。这大大减小了自包含应用程序包的大小。
Letting Qt Core utilize the ICU libraries however has following advantages:
然而,让Qt Core利用ICU库有以下优点:
- Behavior matches other platforms more closely.
- 行为与其他平台更为匹配。
- Extended set of text codecs (see QTextCodec).
- 扩展的文本编解码器集(请参阅QTextCodec)。
- QLocale::toUpper(), QLocale::toLower() always use case conversion rules specific to the locale.
- QLocale::toUpper()、QLocale::toLower()始终使用特定于区域设置的案例转换规则。
- QCollator::setNumericMode() does work consistently on all Windows versions.
- QCollator::setNumericMode()在所有Windows版本上都能一致工作。
To explicitly enable the use of ICU in Qt Core, pass -icu
to configure
:
要在Qt Core中显式启用ICU,请传递-ICU进行配置:
configure -icu
Graphics Drivers
图形驱动
For Qt Quick 2 to work, a graphics driver that provides OpenGL 2.1 or higher is required. The default driver from Windows is OpenGL 1.1. Qt includes a version of the ANGLE project which is included from the Windows Qt installers. ANGLE implements the OpenGL ES 2.0 API on top of DirectX 11 or DirectX 9.
要使Qt Quick 2工作,需要提供OpenGL 2.1或更高版本的图形驱动程序。Windows的默认驱动程序是OpenGL 1.1。Qt包含ANGLE项目的一个版本,该版本包含在Windows Qt安装程序中。ANGLE在DirectX 11或DirectX 9之上实现OpenGL ES 2.0 API。
ANGLE requires that the DirectX SDK is installed when building Qt. If MSVC is used, the DirectX SDK will be provided by the Windows SDK. In this case, you will need at least Windows SDK 10. For MinGW builds, you have to install the DirectX SDK provided by Microsoft.
ANGLE要求在构建Qt时安装DirectX SDK。如果使用MSVC,DirectX SDK将由Windows SDK提供。在这种情况下,至少需要Windows SDK 10。对于MinGW版本,必须安装Microsoft提供的DirectX SDK。
ANGLE chooses the render backend depending on availability. DirectX 11 is usually preferable. However, some graphics cards may not fully support it. For these cases, the environment variable QT_ANGLE_PLATFORM
(introduced in Qt 5.4) can be used to control the render backend. Possible values are d3d11
, d3d9
and warp
.
ANGLE根据可用性选择渲染后端。DirectX 11通常更为可取。但是,某些图形卡可能不完全支持它。对于这些情况,可以使用环境变量QT_ANGLE_PLATFORM(在QT 5.4中引入)来控制渲染后端。可能的值是d3d11、d3d9和warp
。
To use a custom version of ANGLE, set the ANGLE_DIR
environment variable to point to the ANGLE source tree before building Qt.
要使用ANGLE的自定义版本,请在构建Qt之前将ANGLE_DIR环境变量设置为指向ANGLE源树。
If you installed additional OpenGL drivers from your hardware vendor, then you may want to consider using this version of OpenGL instead of ANGLE. To use OpenGL, pass the command line options -opengl desktop
to the configure script.
如果从硬件供应商那里安装了额外的OpenGL驱动程序,那么可能需要考虑使用此版本的OpenGL而不是ANGLE。要使用OpenGL,请将命令行选项-opengl desktop
传递给配置脚本。
configure -opengl desktop
To use an OpenGL ES 2.0 emulator instead of ANGLE, use the configure options: -opengl es2 -no-angle
.
要使用OpenGL ES 2.0模拟器而不是ANGLE,请使用配置选项:-opengl es2 -no-angle
。
configure -opengl es2 -no-angle
Dynamically Loading Graphics Drivers
动态加载图形驱动程序
In addition to the build time configuration, Qt supports choosing and loading the OpenGL implementation at runtime. To use this mode, pass -opengl dynamic
to the configure script.
除了构建时配置外,Qt还支持在运行时选择和加载OpenGL实现。要使用此模式,请将opengl动态传递给配置脚本。
configure -opengl dynamic
Note: As of Qt 5.5 this is the configuration used by the official, pre-built binary packages of Qt. It is strongly recommended to use it also in custom builds, especially for Qt binaries that are deployed alongside applications.
注意:从Qt 5.5开始,这是Qt官方预构建二进制包使用的配置。强烈建议在自定义构建中也使用它,特别是对于与应用程序一起部署的Qt二进制文件。
Note: Combining
-opengl dynamic
with-static
is also possible, but be aware that ANGLE will not be statically linked into the applications in this case, it will still be built as a shared library.注意:将
-opengl dynamic
与-static
相结合也是可能的,但请注意,在这种情况下,ANGLE不会静态链接到应用程序中,它仍将作为共享库构建。
This configuration is the most flexible because no dependencies or assumptions are hardcoded about the OpenGL implementation during build time. It allows robust application deployment. When a given environment fails to provide a proper OpenGL 2.0 implementation, it will fall back automatically to ANGLE. This fallback will be completely transparent to the application, and will allow Qt Quick or other OpenGL code to function by translating to Direct3D. Such a fallback could, for example, take place on a Windows 7 PC with no additional graphics drivers installed. On other machines, where there is sufficient OpenGL support, the normal desktop OpenGL drivers will be used. Additionally, pure software-based OpenGL implementations may be available as additional fallbacks in the future, allowing running Qt Quick applications without a GPU.
这种配置是最灵活的,因为在构建期间没有对OpenGL实现进行硬编码的依赖关系或假设。它允许强大的应用程序部署。当给定的环境无法提供正确的OpenGL 2.0实现时,它将自动回退到ANGLE。这种回退将对应用程序完全透明,并允许Qt Quick或其他OpenGL代码通过转换为Direct3D来运行。例如,这种回退可以在没有安装额外图形驱动程序的Windows 7 PC上进行。在其他有足够OpenGL支持的机器上,将使用正常的桌面OpenGL驱动程序。此外,未来可能会有基于纯软件的OpenGL实现作为额外的后备方案,允许在没有GPU的情况下运行Qt Quick应用程序。
When configured with -opengl dynamic
, neither Qt nor the applications built using qmake
will link to the opengl32 (standard desktop OpenGL) or QtANGLE libraries. Instead, the appropriate library is chosen at runtime. By default, Qt will determine whether the system's opengl32.dll provides OpenGL 2 functions. If these are present, opengl32.dll is used, otherwise the ANGLE libraries (libEGL.dll and libGLESv2.dll) will be used. In case the ANGLE libraries are missing or initialization fails for some reason, an additional fallback is attempted by trying to load opengl32sw.dll
. See below for details.
当配置了-opengl dynamic
时,Qt和使用qmake构建的应用程序都不会链接到opengl32(标准桌面opengl)或QtANGLE库。相反,在运行时选择适当的库。默认情况下,Qt将确定系统的opengl32.dll是否提供OpenGL 2功能。如果存在这些库,则使用opengl32.dll,否则将使用ANGLE库(libEGL.dll和libGLESv2.dll)。如果ANGLE库丢失或初始化因某种原因失败,将尝试通过加载opengl32sw.dll进行额外的回退。详见下文。
The loading mechanism can be configured through the QT_OPENGL
environment variable and the following application attributes:
加载机制可以通过QT_OPENGL环境变量和以下应用程序属性进行配置:
Qt::AA_UseDesktopOpenGL
Equivalent to settingQT_OPENGL
todesktop
.- Qt::AA_UseDesktopOpenGL相当于将Qt_OPENGL设置为
desktop
。 Qt::AA_UseOpenGLES
Equivalent to settingQT_OPENGL
toangle
.- Qt::AA_UseOpenGLES相当于将Qt_OPENGL设置为
angle
。 Qt::AA_UseSoftwareOpenGL
Equivalent to settingQT_OPENGL
tosoftware
.- Qt::AA_UseSoftwareOpenGL相当于将Qt_OPENGL设置为
software
。
When a certain configuration is requested explicitly, no checks are done at application startup, that is, the system-provided opengl32.dll will not be examined.
当明确请求某个配置时,在应用程序启动时不会进行任何检查,也就是说,不会检查系统提供的opengl32.dll。
The dynamic loading has a significant impact on applications that contain native OpenGL calls: they may fail to link since qmake
no longer automatically adds opengl32.lib or libGLESv2.lib. Instead, applications are expected to use the OpenGL functions via the QOpenGLFunctions class. Thus the direct dependency on the OpenGL library is removed and all calls will be routed during runtime to the implementation chosen by Qt.
动态加载对包含本机OpenGL调用的应用程序有重大影响:由于qmake不再自动添加opengl32.lib或libGLESv2.lib,它们可能无法链接。相反,应用程序应该通过QOpenGLFunctions类使用OpenGL函数。因此,消除了对OpenGL库的直接依赖,所有调用都将在运行时路由到Qt选择的实现。
Applications that require a certain OpenGL implementation (for example, desktop OpenGL due to relying on features provided by OpenGL 3.0 or higher) should set the application attributes Qt::AA_UseOpenGLES
or Qt::AA_UseDesktopOpenGL
before instantiating QGuiApplication or QApplication. When these attributes are set, no other OpenGL implementations are considered. Additionally, if they wish to, such applications are free to make direct OpenGL function calls by adding opengl32.lib to their .pro project files: LIBS += opengl32.lib (Visual Studio) or LIBS += -lopengl32 (MinGW). The result is, from the application's perspective, equivalent to the -opengl desktop
build configuration of Qt.
需要特定OpenGL实现的应用程序(例如,由于依赖OpenGL 3.0或更高版本提供的功能,桌面OpenGL)应在实例化QGuiApplication或QApplication之前设置应用程序属性Qt::AA_UseOpenGLES或Qt::AA_UseDesktopOpenGL。设置这些属性后,不会考虑其他OpenGL实现。此外,如果他们愿意,这些应用程序可以通过将opengl32.lib添加到他们的.pro项目文件中来自由地进行直接的OpenGL函数调用:LIBS += opengl32.lib(Visual Studio)或LIBS += -lopengl32(MinGW)。从应用程序的角度来看,其结果相当于Qt的-opengl desktop
构建配置。
Qt::AA_UseSoftwareOpenGL
is special in the sense that it will try to load an OpenGL implementation with a non-standard name. The default name is opengl32sw.dll
. This allows shipping a software-only OpenGL implementation, for example a build of Mesa with llvmpipe, under this name. If necessary, the filename can be overridden by setting the QT_OPENGL_DLL
environment variable.
Qt::AA_UseSoftwareOpenGL的特殊之处在于,它将尝试加载具有非标准名称的OpenGL实现。默认名称为opengl32sw.dll。这允许以该名称发布仅支持软件的OpenGL实现,例如使用llvmpipe构建Mesa。如有必要,可以通过设置QT_OPENGL_DLL环境变量来覆盖文件名。
It is possible to provide a JSON-format configuration file specifying which OpenGL implementation to use depending on the graphics card and driver version. The location is given by the environment variable QT_OPENGL_BUGLIST
. Relative paths are resolved using QLibraryInfo::SettingsPath
or QStandardPaths::ConfigLocation
. The file utilizes the format of the driver bug list used in The Chromium Projects. It consists of a list of entries each of which specifies a set of conditions and a list of feature keywords. Typically, device id and vendor id are used to match a specific graphics card. They can be found in the output of the qtdiag
or dxdiag
tool.
可以提供一个JSON格式的配置文件,根据图形卡和驱动程序版本指定使用哪个OpenGL实现。位置由环境变量QT_OPENGL_BUGLIST给出。使用QLibraryInfo::SettingsPath或QStandardPaths::ConfigLocation解析相对路径。该文件使用Chromium项目中使用的驱动程序错误列表的格式。它由一系列条目组成,每个条目都指定了一组条件和一系列特征关键字。通常,设备id和供应商id用于匹配特定的图形卡。它们可以在qtdiag或dxdiag工具的输出中找到。
The following feature keywords are relevant for choosing the OpenGL implementation:
以下功能关键字与选择OpenGL实现相关:
disable_desktopgl
- Disables OpenGL. This ensures that Qt does not attempt to use regular OpenGL (opengl32.dll), and that it starts with ANGLE right away. This is useful to prevent bad OpenGL drivers from crashing the application.- disable_desktopgl-禁用OpenGL。这确保了Qt不会尝试使用常规OpenGL(opengl32.dll),并且它会立即从ANGLE开始。这有助于防止糟糕的OpenGL驱动程序导致应用程序崩溃。
disable_angle
- Disables ANGLE. Ensures that Qt does not attempt to use ANGLE (and so Direct3D).- disable_angle-禁用ANGLE。确保Qt不会尝试使用ANGLE(以及Direct3D)。
disable_d3d11
- Disables the D3D11 rasterizer in ANGLE. Instead, the next D3D rendering option is tried first. The default order is: D3D11, D3D9, WARP, reference implementation.- disable_d3d11-在ANGLE模式下禁用D3D11光栅化器。相反,首先尝试下一个D3D渲染选项。默认顺序为:D3D1、D3D9、WARP、引用实现。
disable_d3d9
- Disables the D3D9 rasterizer in ANGLE- disable_d3d9-在ANGLE中禁用D3D9光栅化器
disable_rotation
- Forces the application to run in landscape orientation always. It applies to OpengGL only and has no effect when using ANGLE or Software OpenGL implementations. This is intended for drivers that have issues with rotation. This feature keyword was introduced in Qt 5.6.- disable_rotation-强制应用程序始终以横向模式运行。它仅适用于OpengGL,在使用ANGLE或Software OpenGL实现时无效。这适用于有旋转问题的驱动。这个特性关键字是在Qt 5.6中引入的。
disable_program_cache
- Disable storing shader program binaries on disk. This feature keyword was introduced in Qt 5.12.- disable_program_cache-禁用在磁盘上存储着色器程序二进制文件。这个特性关键字是在Qt 5.12中引入的。
A sample file looks like:
示例文件如下:
{
"entries": [
{
"id": 1,
"description": "Disable D3D11 on older nVidia drivers",
"os": {
"type": "win"
},
"vendor_id": "0x10de",
"device_id": ["0x0DE9"],
"driver_version": {
"op": "<=",
"value": "8.17.12.6973"
},
"features": [
"disable_d3d11"
]
},
...
When QT_OPENGL_BUGLIST
is not specified, a built-in list will be used. This typically includes some older, less-capable graphics cards with disable_desktopgl
set, in order to prevent Qt from using their unstable desktop OpenGL implementations and instead fall back to ANGLE right away.
当未指定QT_OPENGL_BUGLIST时,将使用内置列表。这通常包括一些设置了disable_desktopgl的较旧、功能较差的图形卡,以防止Qt使用其不稳定的桌面OpenGL实现,而是立即回退到ANGLE。
In practice the most common combinations are expected to be the following:
在实践中,最常见的组合预计如下:
disable_desktopgl
- In case the system provides OpenGL 2.0 or newer, but the driver is known to be unstable and prone to crash.- disable_desktopgl-如果系统提供OpenGL 2.0或更高版本,但已知驱动程序不稳定且容易崩溃。
disable_desktopgl
, disable_angle - When no accelerated path is desired. This ensures that the only option Qt tries is the sofware rasterizer (opengl32sw.dll). Can be useful in virtual machines and applications that are deployed on a wide range of old systems.- disable_desktopgl,disable_angle-不需要加速路径时。这确保了Qt尝试的唯一选项是软件光栅化器(opengl32sw.dll)。在部署在各种旧系统上的虚拟机和应用程序中非常有用。
disable_d3d11
, disable_d3d9 - When the accelerated D3D options are known to be unstable and WARP is desired (when available). Can be useful in virtual machines.- disable_d3d11,disable_d3d9-当已知加速D3D选项不稳定并且需要WARP时(如果可用)。在虚拟机中可能很有用。
The supported keys for matching a given card or driver are the following. Note that some of these are specific to Qt.
用于匹配给定卡或驱动程序的支持密钥如下。请注意,其中一些是Qt特有的。
os.type
- Operating system:win
,linux
,macosx
,android
os.type-操作系统:win、linux、macosx、android
os.version
- Kernel version- os.version-内核版本
os.release
- Specifies a list of operating system releases on Windows:xp
,vista
,7
,8
,8.1
,10
.- os.release-指定Windows上的操作系统版本列表:xp、vista、7、8、8.1、10。
vendor_id
- Vendor from the adapter identifier- vendor_id-适配器标识符中的供应商
device_id
- List of PCI device IDs.- device_id-PCI设备id列表。
driver_version
- Driver version from the adapter identifier- driver_version-适配器标识符中的驱动程序版本
driver_description
- Matches when the value is a substring of the driver description from the adapter identifier- driver_description-当值是适配器标识符中驱动程序描述的子字符串时匹配
gl_vendor
- Matches when the value is a substring of theGL_VENDOR
string- gl_vendor-当值是
GL_VENDOR
字符串的子字符串时匹配
To disable all blacklisting, set the environment variable QT_NO_OPENGL_BUGLIST
to any value. This will skip reading any configuration files, and instead will assume that nothing is disabled, regardless of the driver or OS.
要禁用所有黑名单,请将环境变量QT_NO_OPENGL_BUGLIST设置为任何值。这将跳过读取任何配置文件,而是假设没有禁用任何内容,无论驱动程序或操作系统如何。
Note: While not typically needed,
QT_NO_OPENGL_BUGLIST
can become relevant in certain virtualized environments, with multiple, possibly virtual, graphics adapters present. If the logs from categories like qt.qpa.gl indicate that the detection of the driver and display adapter leads to incorrectly disabling OpenGL, it is then recommended to set this environment variable in order to enable the application to run normally. This environment variable was introduced in Qt 5.15.注意:虽然通常不需要,但QT_NO_OPENGL_BUGLIST在某些虚拟化环境中可能会变得相关,因为存在多个可能是虚拟的图形适配器。如果qt.qpa.gl等类别的日志表明检测到驱动程序和显示适配器会导致错误地禁用OpenGL,则建议设置此环境变量,以便使应用程序能够正常运行。这个环境变量是在Qt 5.15中引入的。
Building from Source
从源码构建
These tools are not needed to run Qt 5 applications, but they are required for building Qt 5 from source.
运行Qt 5应用程序不需要这些工具,但从源代码构建Qt 5需要这些工具。
- Perl - Install a recent version of perl (for instance (Strawberry Perl) and add the installation location to your
PATH
. - Perl-安装最新版本的Perl(例如(草莓Perl)),并将安装位置添加到PATH中。
- Python - Install Python from the here and add the installation location to your
PATH
. - Python-从这里安装Python,并将安装位置添加到PATH中。
ANGLE depends on these extra tools from the GnuWin32 and Win flex-bison projects, which are provided for your convenience in the gnuwin32/bin folder:
ANGLE依赖于GnuWin32和Win-flex bison项目中的这些额外工具,为了方便,这些工具在GnuWin32/bin文件夹中提供:
The gnuwin32/bin folder should be added to the PATH
variable.
gnuwin32/bin文件夹应添加到PATH变量中。
Note: If you are building qtbase outside of qt5.git, you will need to download win_bison and win_flex from the link above and rename them to bison and flex.
注意:如果你在qt5.git之外构建qtbase,你需要从上面的链接下载win_bison和win_flex,并将它们重命名为bison和flex。
For instructions for building the Qt 5 source, read the Qt for Windows - Building from Source page.
有关构建Qt 5源代码的说明,请阅读Qt For Windows-从源代码构建页面。
Compilers
编译器
Visual Studio
Qt can be built with Visual Studio 2015 (Update 2), Visual Studio 2017, Visual Studio 2019 and Build Tools for Visual Studio 2017 and 2019 (see also Supported Platforms).
Qt可以使用Visual Studio 2015(更新2)、Visual Studio 2017、Visual Studio 2019以及Visual Studio 2017和2019的构建工具构建(另请参阅支持的平台)。
Intel C++ Compiler (Windows, Altix)
英特尔C++编译器(Windows、Altix)
Qt has been tested successfully with:
Qt已成功通过以下测试:
- Windows - Intel(R) C++ Compiler for 32-bit applications, Version 9.1.040.
- Windows-适用于32位应用程序的英特尔(R)C++编译器,版本9.1.040。
- Altix - Intel(R) C++ Itanium(R) Compiler for Itanium(R)-based applications Version 8.1 Build 20050406 Package ID: l_cc_pc_8.1.030
- Altix-用于基于安腾(R)的应用程序的英特尔(R)C++安腾(l)编译器版本8.1内部版本20050406包ID:l_cc_pc_8.1.030
GCC (MinGW-builds)
GCC(MinGW构建)
The minimum version of MinGW-builds supported is GCC 5.1.0 (64bit, 32bit), available from its download page.
支持的MinGW构建的最低版本是GCC 5.1.0(64位、32位),可从其下载页面获得。
For more information about the MinGW builds, visit the Reference Configuration section of the supported platforms page.
有关MinGW构建的更多信息,请访问支持平台页面的参考配置部分。
Clang(clang-cl)
Qt has been tested successfully with Clang 3.8(llvm svn rev. 256453 and clang svn rev. 256453). Visual Studio 2015 Update 1 was used to build clang. Mkspec is using the clang-cl tool to build Qt. Clang 3.8 does not support precompiled headers.
Qt已经成功地用Clang 3.8(llvm-svn版本256453和Clang-svn版本256453)进行了测试。Visual Studio 2015 Update 1用于构建clang。Mkspec正在使用clang-cl工具来构建Qt。Clang 3.8不支持预编译头文件。
Building Qt WebEngine
构建Qt Web引擎
Qt WebEngine has additional build requirements which are listed in the Qt WebEngine Platform Notes.
Qt WebEngine有额外的构建要求,这些要求在Qt WebEngine平台说明中列出。
QDoc Dependencies
QDoc依赖关系
Since version 5.11, QDoc uses Clang to parse C++ code. If you wish to build QDoc manually, refer to Installing Clang for QDoc for specific build requirements.
从5.11版本开始,QDoc使用Clang来解析C++代码。如果希望手动构建QDoc,请参阅安装用于QDoc的Clang以了解具体的构建要求。
See also QDoc Dependencies.
另请参见QDoc依赖关系。
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.