久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 Windows 上部署 Qt 5 應用程序

Deploying Qt 5 App on Windows(在 Windows 上部署 Qt 5 應用程序)
本文介紹了在 Windows 上部署 Qt 5 應用程序的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我用 QML(Qt 5 的一部分)編寫了幾個應用程序.在我之前提出的一個問題中 (https://softwareengineering.stackexchange.com/questions/213698/deploying-qt-based-app-on-mac-os-x),我找到了在 OS X 上部署我的應用程序的解決方案(使用 macdeployqt 工具).

I've written a couple of applications in QML (part of Qt 5). In a question that I've made before (https://softwareengineering.stackexchange.com/questions/213698/deploying-qt-based-app-on-mac-os-x), I found the solution for deploying my app on OS X (using the macdeployqt tool).

在 Windows 上部署 Qt4 應用程序很容易:

Deploying Qt4 apps on Windows was easy:

  1. 您在發布模式下編譯它.
  2. 您復制了必要的庫 (DLL).
  3. 您進行了測試,效果很好.

不幸的是,這種方法在 Qt5 中不起作用(我什至在 qwindows.dll 文件中包含了平臺文件夾,但它不起作用).經過幾天的嘗試,我放棄并編譯了一個靜態版本的Qt5.

Unfortunately, this approach did not work in Qt5 (I even included the platforms folder with the qwindows.dll file and it did not work). After some days of trying, I gave up and compiled a static version of Qt5.

同樣,它不起作用.該應用程序可在安裝了 Qt 的 PC 上運行,但在干凈"的 PC 上會崩潰.作為旁注,Windows 8/8.1 系統不會發出警告或消息通知我有關應用程序崩潰的信息.但是在 Windows 7 中,一條消息通知我應用程序崩潰了.

Again, it did not work. The app works on a PC with Qt installed, but it crashes on "clean" PCs. As a side note, Windows 8/8.1 systems don't give a warning or a message notifying me about the app's crash. But in Windows 7 a message notifies me that the application crashed.

我試過運行 Dependency Walker (depends.exe),我的應用程序靜態構建中的所有庫看起來都很好.

I've tried running Dependency Walker (depends.exe) and all libraries in the static build of my application seemed fine.

在 Windows 8 中,我沒有收到任何錯誤.但是在depends.exe 中分析應用程序后,我收到了來自QtGui.dll 的訪問沖突.確切的錯誤是

In Windows 8, I don't get any error. But after profiling the app in depends.exe, I get an access violation originating from QtGui.dll. The exact error is

在地址 0x61C2C000 的QT5GUI.DLL"中發生第二次機會異常 0xC0000005(訪問沖突).

Second chance exception 0xC0000005 (Access Violation) occurred in "QT5GUI.DLL" at address 0x61C2C000.

有什么我遺漏的嗎(比如一個額外的 DLL 或配置文件)?

Is there something that I am missing (say an extra DLL or config file)?

申請信息:

  • 使用 Qt 5.2.1 編寫和編譯
  • 使用 Quick/QML.
  • 使用網絡模塊.
  • 使用 webkit 模塊.
  • 使用藍牙模塊.
  • QML 文件是用 Quick 2.2 編寫的

推薦答案

在 Qt 論壇中挖掘了幾個小時后,我發現我需要復制qml"文件夾(通常位于 C:/Qt/5.2.1/qml) 到應用程序的根目錄.這樣做之后,我的應用程序的動態和靜態版本都可以在普通系統上運行.

After some hours digging in the Qt Forums, I found out that I need to copy the "qml" folder (normally located in C:/Qt/5.2.1/qml) to the application's root directory. After doing so, both the dynamic and static versions of my application worked on vanilla systems.

程序目錄(MinGW 4.8 32 位,動態):

正如 hyde 所說,使用 windeployqt 工具(;inwindeployqt.exe) 將必要的文件復制到應用程序的文件夾中.之后,將所需的 QML 組件從 qml 復制到您的應用程序文件夾.生成的文件夾應類似于:

As hyde said, use the windeployqt tool (<qt path><version>inwindeployqt.exe) to copy the necessary files to your application's folder. After that, copy the required QML components from <qt path><version>qml to your application's folder. The resulting folder should look similar to:

  • 平臺(文件夾)
  • QtQuick(文件夾)
  • QtQuick.2(文件夾)
  • 您需要的任何其他 QML 組件
  • app.exe
  • icudt51.dll
  • icuin51.dll
  • icuuc51.dll
  • libgcc_s_dw2-1.dll
  • libstdc++-6.dll
  • libwindthread-1.dll
  • Qt5Core.dll
  • Qt5Gui.dll
  • Qt5Qml.dll
  • Qt5Quick.dll
  • Qt5Network.dll
  • Qt5Widgets.dll

程序目錄(靜態)

靜態編譯應用程序,然后將所需的 QML 組件從 qml 復制到應用程序的文件夾中.生成的文件夾應類似于:

Compile the application statically, then copy the required QML components from <qt path><version>qml to your application's folder. The resulting folder should look similar to:

  • QtQuick(文件夾)
  • QtQuick.2(文件夾)
  • 您需要的任何其他 QML 組件
  • app.exe

我認為崩潰的原因是 Qt5Gui.dll(動態和靜態)在運行時嘗試"加載 QtQuick* 文件夾,但找不到它們(因此崩潰了加載期間的應用程序).

I think the cause for the crash was that the Qt5Gui.dll (dynamic and static) "tried" to load the QtQuick* folders during run time, but could not find them (thus crashing the application during load).

這篇關于在 Windows 上部署 Qt 5 應用程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

boost_1_60_0 .zip installation in windows(Windows 中的 boost_1_60_0 .zip 安裝)
How do I get console output in C++ with a Windows program?(如何使用 Windows 程序在 C++ 中獲得控制臺輸出?)
How do I calculate the week number given a date?(如何計算給定日期的周數?)
OpenCV with Network Cameras(帶有網絡攝像機的 OpenCV)
Export all symbols when creating a DLL(創建 DLL 時導出所有符號)
Getting started with OpenCV 2.4 and MinGW on Windows 7(Windows 7 上的 OpenCV 2.4 和 MinGW 入門)
主站蜘蛛池模板: 国产成人精品午夜视频免费 | 欧美日韩中文字幕在线播放 | 久久aⅴ乱码一区二区三区 亚洲国产成人精品久久久国产成人一区 | 久久高清亚洲 | 国内久久 | 欧美成人精品二区三区99精品 | 久久免费精彩视频 | 亚洲情综合五月天 | 亚洲精品一区二三区不卡 | 成人精品鲁一区一区二区 | 久久免费精品 | 人人鲁人人莫人人爱精品 | 一区二区三区日 | 6080亚洲精品一区二区 | 欧美 日韩 亚洲91麻豆精品 | 在线免费观看黄a | 成人精品网 | 亚洲成人一级 | 欧美在线小视频 | 韩日精品一区 | 亚洲国产高清免费 | 色婷综合网 | 国产精品中文在线 | 亚洲97 | 91在线视频国产 | 国内精品视频 | 久久91精品国产 | 中文字幕成人av | 国产在线视频三区 | 亚洲免费一区二区 | 中文字幕在线不卡播放 | 97中文视频| 一区二区三区欧美在线 | 在线久草| 色综合一区二区三区 | 91精品国产91久久综合桃花 | 久久久久久久久久久福利观看 | 婷婷去俺也去 | 成人深夜福利网站 | 亚洲区一 | 国产精品污www在线观看 |