【问题标题】:Can't run Qt application under UWP kit无法在 UWP 套件下运行 Qt 应用程序
【发布时间】:2017-05-04 06:32:36
【问题描述】:

我的应用是基于 Qt Quick Controls 2 的应用。 Qt 5.7.1、Windows 10、Visual Studio 2015。

桌面 32 位版本工作正常。

但是当我切换到 Qt 5.7.1 for Universal Windows Platform 32bit 套件时,它无法运行并出现以下错误:

winrtrunner --device 0 --start --stop --install --wait 0 --profile appx C:/Work/Source/build-MusicPlayer-Qt_5_7_1_for_Universal_Windows_Platform_32bit-Release/bin/player.exe
qt.winrtrunner: Using the Appx profile.
qt.winrtrunner: Failed to activate application: 0x8027025b "The app didn't start."
Error while executing the WinRT Runner Tool: Process crashed

它指出here 缺少某些依赖项。我已经使用 Dependency Walker 检查了它,似乎所有必需的 DLL 都在应用程序的文件夹中。我还尝试将 Qt 工具包安装中的所有文件复制到应用程序的目录中。

我的应用程序由一个主要的可执行文件和三个 .DLL 文件组成。我已经为他们每个人启动了windeployqt。尝试了调试和发布版本。

【问题讨论】:

    标签: qt windows-runtime qtquickcontrols2


    【解决方案1】:

    我在 Windows 10、Qt 5.8(也是 5.7)、Windows Runtime 64bit VC2015 上遇到了同样的问题。

    这个话题是在Qt网站上打开的:https://forum.qt.io/topic/73272/qt-5-7-for-winrt-and-dynamic-libraries,但对我来说没有帮助:(。我在这里打开了一个新话题:https://forum.qt.io/topic/75424/cannot-start-qt-quick-winrt-application

    【讨论】:

    【解决方案2】:

    我有同样的问题。

    您需要重新编译应用程序用于 Windows 10 SDK 的所有静态/动态库。问题是您需要使用提供沙盒环境的 WinRT dll,而不是“普通”Windows 库。 Windows 应用商店应用程序需要这样做。

    在我的例子中,我使用 zip 静态库 (zlibstat.lib) 和 Quazip 静态库 (quazip.lib),在 Windows 7 中使用 Visual Studio 2012 编译。

    相反,我使用了 Qt zip,因为 Qt 在 QtCore.dll 中提供了 zip 库(只需使用 #include 而不是 #include "zlib.h")并将 Quazip 重新编译为 Windows 10 SDK 的静态库。

    【讨论】:

      猜你喜欢
      • 2012-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多