MinGW 11.2.0 64-bit编译Qt 5.15.13

在线安装的版本最高直到 5.15.2,前段时间看到了5.15.13的源码放出来了正好可以试试。
Qt默认是使用MinGW 8.1来编译的,如过你还是用这个版本那么不需要什么修改直接就可以进行编译。
MinGW 11.2需要做些小改动才可以。
需要准备的工具:MinGW 11.2RubyStrawberry PerlPython2
MinGW建议直接用qt的,Ruby、Perl这里我是直接下载的最新版,Python要使用python2版本。

这些工具都必须要设置在环境变量中。

可能会遇到的问题,建议先改好再做构建:
1、note: previous definition of ‘struct _FILE_ID_INFO’:
文件./qtbase/src/corelib/io/qfilesystemengine_win.cpp 667行:

#if defined(Q_CC_MINGW) && WINVER < 0x0602 //  Windows 8 onwards

typedef struct _FILE_ID_INFO {
    ULONGLONG VolumeSerialNumber;
    FILE_ID_128 FileId;
} FILE_ID_INFO, *PFILE_ID_INFO;

#endif // if defined (Q_CC_MINGW) && WINVER < 0x0602

修改为:

#if defined(Q_CC_MINGW) && WINVER < 0x0602 && !(_WIN32_WINNT >= _WIN32_WINNT_WIN8) //  Windows 8 onwards

typedef struct _FILE_ID_INFO {
    ULONGLONG VolumeSerialNumber;
    FILE_ID_128 FileId;
} FILE_ID_INFO, *PFILE_ID_INFO;

#endif // if defined (Q_CC_MINGW) && WINVER < 0x0602

https://bugreports.qt.io/browse/QTBUG-94031

  1. fxc.exe /nologo /E VS_VertexColor /T vs_5_0 /Fh vs_vertexcolor.hlslh shaders\vertexcolor.hlsl
    process_begin: CreateProcess(NULL, fxc.exe /nologo /E VS_VertexColor /T vs_5_0 /Fh vs_vertexcolor.hlslh shaders\vertexcolor.hlsl, …) failed.
    make (e=2): 系统找不到指定的文件。
    使用evenrything或系统搜索工具查找fxc.exe文件,设置CMD构建窗口设置环境变量:
set path=%path%;C:\Program Files (x86)\Windows Kits\10\bin\x64;
  1. D3D12问题:
qsgd3d12engine.cpp:783:47: error: 'suppressedMessages' was not declared in this scope
  783 |             filter.DenyList.NumIDs = _countof(suppressedMessages);
      |                                               ^~~~~~~~~~~~~~~~~~
qsgd3d12engine.cpp:786:13: error: 'D3D12_MESSAGE_SEVERITY' was not declared in this scope; did you mean 'D3D10_MESSAGE_SEVERITY'?
  786 |             D3D12_MESSAGE_SEVERITY infoSev = D3D12_MESSAGE_SEVERITY_INFO;
      |             ^~~~~~~~~~~~~~~~~~~~~~
      |             D3D10_MESSAGE_SEVERITY
qsgd3d12engine.cpp:788:46: error: 'infoSev' was not declared in this scope
  788 |             filter.DenyList.pSeverityList = &infoSev;
      |                                              ^~~~~~~
qsgd3d12engine.cpp:789:22: error: base operand of '->' is not a pointer
  789 |             infoQueue->PushStorageFilter(&filter);

做如下(5处)修改:

diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
index 75bde2c66b..3594878eca 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
@@ -221,7 +221,7 @@ static void getHardwareAdapter(IDXGIFactory1 *factory, IDXGIAdapter1 **outAdapte
         if (SUCCEEDED(factory->EnumAdapters1(adapterIndex, &adapter))) {
             adapter->GetDesc1(&desc);
             const QString name = QString::fromUtf16((char16_t *) desc.Description);
-            HRESULT hr = D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr);
+            HRESULT hr = D3D12CreateDevice(adapter.Get(), fl, __uuidof(ID3D12Device), nullptr);
             if (SUCCEEDED(hr)) {
                 qCDebug(QSG_LOG_INFO_GENERAL, "Using requested adapter '%s'", qPrintable(name));
                 *outAdapter = adapter.Detach();
@@ -238,7 +238,7 @@ static void getHardwareAdapter(IDXGIFactory1 *factory, IDXGIAdapter1 **outAdapte
         if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE)
             continue;

-        if (SUCCEEDED(D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr))) {
+        if (SUCCEEDED(D3D12CreateDevice(adapter.Get(), fl, __uuidof(ID3D12Device), nullptr))) {
             const QString name = QString::fromUtf16((char16_t *) desc.Description);
             qCDebug(QSG_LOG_INFO_GENERAL, "Using adapter '%s'", qPrintable(name));
             break;
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12engine_p_p.h b/src/plugins/scenegraph/d3d12/qsgd3d12engine_p_p.h
index a95cbb1cbb..54a2c4dc8f 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12engine_p_p.h
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12engine_p_p.h
@@ -55,6 +55,7 @@
 #include <QCache>

 #include <d3d12.h>
+#include <d3d12sdklayers.h>
 #include <dxgi1_4.h>
 #include <dcomp.h>
 #include <wrl/client.h>
@@ -263,8 +264,8 @@ private:
     void beginFrameDraw();
     void endDrawCalls(bool lastInFrame = false);

-    static const int MAX_SWAP_CHAIN_BUFFER_COUNT = 4;
-    static const int MAX_FRAME_IN_FLIGHT_COUNT = 4;
+    static inline const int MAX_SWAP_CHAIN_BUFFER_COUNT = 4;
+    static inline const int MAX_FRAME_IN_FLIGHT_COUNT = 4;

     bool initialized = false;
     bool inFrame = false;

https://gist.github.com/JohannesKauffmann/2e08efc2a11dc16b737a4b7f6fa4744d

  1. 编译MySql插件需要在命令中附加MySql头文件路径和库路径:-I "G:/mysql-8.0.36-winx64/include" -L "G:/mysql-8.0.36-winx64/lib",不能使用8.3的版本,会报ssl错误。不编译MySQl插件可以不加。

我的编译参数:

configure -confirm-license -opensource -debug-and-release -shared -opengl desktop -prefix "D:\Qt\5.15.13\mingw_64\debug_and_release" -nomake tests -no-compile-examples -nomake examples -skip qtwebengine -recheck-all -I "G:/mysql-8.0.36-winx64/include" -L "G:/mysql-8.0.36-winx64/lib"
Configure summary:

Build type: win32-g++ (x86_64, CPU features: cx16 mmx sse sse2 sse3)
Compiler: gcc 11.2.0
Configuration: sse2 aesni sse3 ssse3 sse4_1 sse4_2 largefile optimize_debug precompile_header rdrnd rdseed shani x86SimdAlways shared shared debug_and_release debug release build_all c++11 c++14 c++17 c++1z concurrent dbus no-pkg-config stl
Build options:
  Mode ................................... debug and release; default link: release
  Optimize debug build ................... yes
  Optimize release build for size ........ no
  Building shared libraries .............. yes
  Using C standard ....................... C11
  Using C++ standard ..................... C++17
  Generating GDB index ................... no
  Relocatable ............................ yes
  Using precompiled headers .............. yes
  Using LTCG ............................. no
  Target compiler supports:
    SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
    AVX .................................. <none>
    AVX512 ............................... <none>
    Other x86 ............................ AES RDRAND SHA
    Intrinsics without -mXXX option ...... yes
  Build parts ............................ libs tools
  App store compliance ................... no
Qt modules and options:
  Qt Concurrent .......................... yes
  Qt D-Bus ............................... yes
  Qt D-Bus directly linked to libdbus .... no
  Qt Gui ................................. yes
  Qt Network ............................. yes
  Qt Sql ................................. yes
  Qt Testlib ............................. yes
  Qt Widgets ............................. yes
  Qt Xml ................................. yes
Support enabled for:
  Using pkg-config ....................... no
  udev ................................... no
  Using system zlib ...................... yes
  Zstandard support ...................... no
Qt Core:
  DoubleConversion ....................... yes
    Using system DoubleConversion ........ no
  GLib ................................... no
  iconv .................................. no
  ICU .................................... no
  Built-in copy of the MIME database ..... yes
  Tracing backend ........................ <none>
  Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
  PCRE2 .................................. yes
    Using system PCRE2 ................... no
Qt Network:
  getifaddrs() ........................... no
  IPv6 ifname ............................ no
  libproxy ............................... no
  Schannel ............................... no
  OpenSSL ................................ no
    Qt directly linked to OpenSSL ........ no
  OpenSSL 1.1 ............................ no
  DTLS ................................... no
  OCSP-stapling .......................... no
  SCTP ................................... no
  Use system proxies ..................... yes
  GSSAPI ................................. no
Qt Gui:
  Accessibility .......................... yes
  FreeType ............................... yes
    Using system FreeType ................ no
  HarfBuzz ............................... yes
    Using system HarfBuzz ................ no
  Fontconfig ............................. no
  Image formats:
    GIF .................................. yes
    ICO .................................. yes
    JPEG ................................. yes
      Using system libjpeg ............... no
    PNG .................................. yes
      Using system libpng ................ no
  Text formats:
    HtmlParser ........................... yes
    CssParser ............................ yes
    OdfWriter ............................ yes
    MarkdownReader ....................... yes
      Using system libmd4c ............... no
    MarkdownWriter ....................... yes
  EGL .................................... no
  OpenVG ................................. no
  OpenGL:
    ANGLE ................................ no
    Desktop OpenGL ....................... yes
    Dynamic OpenGL ....................... no
    OpenGL ES 2.0 ........................ no
    OpenGL ES 3.0 ........................ no
    OpenGL ES 3.1 ........................ no
    OpenGL ES 3.2 ........................ no
  Vulkan ................................. no
  Session Management ..................... yes
Features used by QPA backends:
  evdev .................................. no
  libinput ............................... no
  INTEGRITY HID .......................... no
  mtdev .................................. no
  tslib .................................. no
  xkbcommon .............................. no
  X11 specific:
    XLib ................................. no
    XCB Xlib ............................. no
    EGL on X11 ........................... no
    xkbcommon-x11 ........................ no
QPA backends:
  DirectFB ............................... no
  EGLFS .................................. no
  LinuxFB ................................ no
  VNC .................................... no
  Windows:
    Direct 2D ............................ yes
    DirectWrite .......................... yes
    DirectWrite 2 ........................ yes
Qt Sql:
  SQL item models ........................ yes
Qt Widgets:
  GTK+ ................................... no
  Styles ................................. Fusion Windows WindowsVista
Qt PrintSupport:
  CUPS ................................... no
Qt Sql Drivers:
  DB2 (IBM) .............................. no
  InterBase .............................. no
  MySql .................................. yes
  OCI (Oracle) ........................... no
  ODBC ................................... yes
  PostgreSQL ............................. no
  SQLite2 ................................ no
  SQLite ................................. yes
    Using system provided SQLite ......... no
  TDS (Sybase) ........................... no
Qt Testlib:
  Tester for item models ................. yes
Serial Port:
  ntddmodm ............................... yes
Qt SerialBus:
  Socket CAN ............................. no
  Socket CAN FD .......................... no
  SerialPort Support ..................... yes
Further Image Formats:
  JasPer ................................. no
  MNG .................................... no
  TIFF ................................... yes
    Using system libtiff ................. no
  WEBP ................................... yes
    Using system libwebp ................. no
Qt QML:
  QML network support .................... yes
  QML debugging and profiling support .... yes
  QML just-in-time compiler .............. yes
  QML sequence object .................... yes
  QML XML http request ................... yes
  QML Locale ............................. yes
Qt QML Models:
  QML list model ......................... yes
  QML delegate model ..................... yes
Qt Quick:
  Direct3D 12 ............................ yes
  AnimatedImage item ..................... yes
  Canvas item ............................ yes
  Support for Qt Quick Designer .......... yes
  Flipable item .......................... yes
  GridView item .......................... yes
  ListView item .......................... yes
  TableView item ......................... yes
  Path support ........................... yes
  PathView item .......................... yes
  Positioner items ....................... yes
  Repeater item .......................... yes
  ShaderEffect item ...................... yes
  Sprite item ............................ yes
QtQuick3D:
  Assimp ................................. yes
  System Assimp .......................... no
Qt Scxml:
  ECMAScript data model for QtScxml ...... yes
Qt Gamepad:
  SDL2 ................................... no
Qt 3D:
  Assimp ................................. yes
  System Assimp .......................... no
  Output Qt3D GL traces .................. no
  Use SSE2 instructions .................. yes
  Use AVX2 instructions .................. no
  Aspects:
    Render aspect ........................ yes
    Input aspect ......................... yes
    Logic aspect ......................... yes
    Animation aspect ..................... yes
    Extras aspect ........................ yes
Qt 3D Renderers:
  OpenGL Renderer ........................ yes
  RHI Renderer ........................... no
Qt 3D GeometryLoaders:
  Autodesk FBX ........................... no
Qt Wayland Client ........................ no
Qt Wayland Compositor .................... no
Qt Bluetooth:
  BlueZ .................................. no
  BlueZ Low Energy ....................... no
  Linux Crypto API ....................... no
  Native Win32 Bluetooth ................. no
  WinRT Bluetooth API (desktop & UWP) .... no
  WinRT advanced bluetooth low energy API (desktop & UWP) . no
Qt Sensors:
  sensorfw ............................... no
Qt Quick Controls 2:
  Styles ................................. Default Fusion Imagine Material Universal
Qt Quick Templates 2:
  Hover support .......................... yes
  Multi-touch support .................... yes
Qt Positioning:
  Gypsy GPS Daemon ....................... no
  WinRT Geolocation API .................. no
Qt Location:
  Qt.labs.location experimental QML plugin . no
  Geoservice plugins:
    OpenStreetMap ........................ yes
    HERE ................................. yes
    Esri ................................. yes
    Mapbox ............................... yes
    MapboxGL ............................. yes
    Itemsoverlay ......................... yes
QtXmlPatterns:
  XML schema support ..................... yes
Qt Multimedia:
  ALSA ................................... no
  GStreamer 1.0 .......................... no
  GStreamer 0.10 ......................... no
  Video for Linux ........................ no
  OpenAL ................................. no
  PulseAudio ............................. no
  Resource Policy (libresourceqt5) ....... no
  Windows Audio Services ................. no
  DirectShow ............................. yes
  Windows Media Foundation ............... yes
Qt TextToSpeech:
  Flite .................................. no
  Flite with ALSA ........................ no
  Speech Dispatcher ...................... no
Qt Tools:
  Qt Assistant ........................... yes
  Qt Designer ............................ yes
  Qt Distance Field Generator ............ yes
  kmap2qmap .............................. yes
  Qt Linguist ............................ yes
  Mac Deployment Tool .................... no
  makeqpf ................................ yes
  pixeltool .............................. yes
  qdbus .................................. yes
  qev .................................... yes
  Qt Attributions Scanner ................ yes
  qtdiag ................................. yes
  qtpaths ................................ yes
  qtplugininfo ........................... yes
  Windows deployment tool ................ yes
  WinRT Runner Tool ...................... no
Qt Tools:
  QDoc ................................... no

Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.

WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.

Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation.
On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
On macOS, you can use Homebrew's llvm package.
On Windows, you must set LLVM_INSTALL_DIR to the installation path.

Qt is now configured for building. Just run 'mingw32-make'.
Once everything is built, you must run 'mingw32-make install'.
Qt will be installed into 'D:\Qt\5.15.13\mingw_64\debug_and_release'.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

配置成功后就可以开始编译了,使用mingw32-make -j20指令进行编译,j20表示使用20个线程编译,具体根据你的计算机进行调整。
编译完成后使用mingw32-make install进行安装。安装路径是在configure中-prefix指定的。

不想自己编译的,可以直接下载网友构建的版本。里面很全,安全性不做保证。
https://fsu0413.gitee.io/qtcompile/index.html

  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: qt-opensource-windows-x86-5.9.0是指Qt公司开源的软件开发工具包的一个版本。Qt是一个跨平台的C++应用程序开发框架,可以帮助开发者快速构建跨平台的应用程序。 qt-opensource-windows-x86-5.9.0是适用于Windows操作系统的一个版本,x86表示它适用于32位的操作系统。这个版本的Qt是开源的,意味着它的源代码可以被公开访问和使用。 Qt-opensource-windows-x86-5.9.0提供了丰富的功能和开发工具,包括图形用户界面设计工具、图形渲染引擎、网络模块等。它还包含了各种常用的库和类,可以帮助开发者快速构建功能强大的应用程序。 使用qt-opensource-windows-x86-5.9.0进行开发可以带来许多好处。首先,Qt具有良好的跨平台性,可以很方便地将应用程序移植到其他平台,减少了开发的工作量。其次,Qt提供了大量的文档和教程,可以帮助开发者学习和使用Qt框架。此外,Qt还有一个活跃的社区,开发者可以在这个社区中获取支持和交流经验。 总的来说,qt-opensource-windows-x86-5.9.0是一个功能强大、易于使用的软件开发工具包,可以帮助开发者快速构建跨平台的应用程序。无论是初学者还是有经验的开发者,都可以从Qt框架中受益。 ### 回答2: qt-opensource-windows-x86-5.9.0是一款开源的跨平台应用程序开发框架,可以用于开发各种类型的桌面和移动应用程序。它是由Qt公司开发并于2017年发布的最新版本。 使用qt开发程序具有许多优点。首先,它提供了丰富而强大的功能和组件,可以快速创建出功能完备的应用程序。Qt拥有众多的模块和工具,可用于处理图形、网络通信、数据库访问等多种任务。 其次,Qt是跨平台的,可以在不同的操作系统上运行,如Windows、Linux、Mac OS等。这意味着开发者可以用一套代码编写应用程序,然后将其编译在不同平台上使用,避免了重复开发的工作。 另外,Qt提供了友好的集成开发环境(IDE),名为Qt Creator。Qt Creator包含了一系列开发工具,如调试器、图形化界面编辑器等,方便开发者进行程序的编写和调试。 Qt还支持许多编程语言,如C++、Python等,这给开发者提供了更多的选择。通过使用Qt,开发者可以根据自己的需求选择合适的语言进行开发。 总而言之,qt-opensource-windows-x86-5.9.0是一款功能强大、跨平台且易于使用的应用程序开发框架。它提供了丰富的功能和组件、友好的开发环境以及灵活的语言支持,非常适合开发各种类型的应用程序。 ### 回答3: qt-opensource-windows-x86-5.9.0是Qt公司开发的一款开源的跨平台应用程序开发框架。它可以用于开发桌面应用程序、移动应用程序、嵌入式系统以及其他各种类型的应用程序。 Qt框架具有丰富的功能和强大的性能。它提供了一套易于使用的API,可以帮助开发者快速构建出高质量的应用程序。Qt框架支持多种编程语言,包括C++、QML和JavaScript,开发者可以根据自己的喜好选择适合自己的编程语言。 Qt框架还提供了许多强大的工具和组件,包括图形引擎、网络模块、数据库连接、XML处理、多媒体支持等等。这些工具和组件可以帮助开发者轻松地实现各种功能,提升应用程序的质量和用户体验。 对于Windows平台的开发者来说,Qt框架提供了一套完整的开发工具,包括Qt Creator集成开发环境和Qt Designer界面设计器。Qt Creator可以帮助开发者编写、调试、测试和部署应用程序,而Qt Designer可以帮助开发者设计、编辑和布局应用程序的界面。 总的来说,qt-opensource-windows-x86-5.9.0是一款非常强大且易于使用的开源开发框架,它为开发者提供了丰富的功能和工具,可以帮助他们快速构建高质量的应用程序。无论是开发桌面应用程序,还是移动应用程序,都可以选择Qt框架作为开发工具,提升开发效率和质量。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值