无法将 Qt Quick 应用程序部署到 Mac OSX [英] Can't deploy Qt Quick app to Mac OSX

查看:13
本文介绍了无法将 Qt Quick 应用程序部署到 Mac OSX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将应用程序部署到 Mac OSX,但它不起作用.

I'm trying to deploy an application to Mac OSX, but it doesn't work.

在构建我的应用程序后,它似乎工作正常,在 Qt Creator 中运行,我使用 QML 和 C++ 来构建应用程序.我用过命令行:

After build my app it seems to be working fine, running inside Qt Creator, I used QML and C++ to build the app. I've used the command line:

macdeployqt MyApp.app -dmg

之后会生成一个 .dmg 文件,但里面的应用程序不起作用.它打开一个空窗口.更糟糕的是,在部署应用程序执行后,我在 Qt Creator 中的应用程序开始只显示一个空窗口,显示以下输出:

After that a .dmg file is generated but the app inside that doesn't work. It opens an empty window. Worse than that, after deployed app execution also my app in Qt Creator starts to show only an empty window showing the following output:

qrc:/qml/main.qml:1:1: 模块QtQuick"未安装
qrc:/qml/main.qml:4:1: 未安装模块QtQuick.Controls"
qrc:/qml/main.qml:2:1: 未安装模块QtQuick.Dialogs"
qrc:/qml/main.qml:1:1: 未安装模块QtQuick"
qrc:/qml/main.qml:4:1: 未安装模块QtQuick.Controls"
qrc:/qml/main.qml:2:1: 未安装模块QtQuick.Dialogs"
qrc:/qml/main.qml:1:1: 未安装模块QtQuick"
qrc:/qml/main.qml:4:1: 未安装模块QtQuick.Controls"
qrc:/qml/main.qml:2:1: 未安装模块QtQuick.Dialogs"

qrc:/qml/main.qml:1:1: module "QtQuick" is not installed
qrc:/qml/main.qml:4:1: module "QtQuick.Controls" is not installed
qrc:/qml/main.qml:2:1: module "QtQuick.Dialogs" is not installed
qrc:/qml/main.qml:1:1: module "QtQuick" is not installed
qrc:/qml/main.qml:4:1: module "QtQuick.Controls" is not installed
qrc:/qml/main.qml:2:1: module "QtQuick.Dialogs" is not installed
qrc:/qml/main.qml:1:1: module "QtQuick" is not installed
qrc:/qml/main.qml:4:1: module "QtQuick.Controls" is not installed
qrc:/qml/main.qml:2:1: module "QtQuick.Dialogs" is not installed

otool -L 告诉我这个:

@executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick(兼容版本5.2.0,当前版本5.2.0)
@executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml(兼容版本5.2.0,当前版本5.2.0)
@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork(兼容版本5.2.0,当前版本5.2.0)
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore(兼容版本5.2.0,当前版本5.2.0)
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui(兼容版本5.2.0,当前版本5.2.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL(兼容版本1.0.0,当前版本1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL(兼容性版本 1.0.0,当前版本 1.0.0)/usr/lib/libstdc++.6.dylib(兼容版本7.0.0,当前版本60.0.0)
/usr/lib/libSystem.B.dylib(兼容版本 1.0.0,当前版本 1197.1.1)

@executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.2.0, current version 5.2.0)
@executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.2.0, current version 5.2.0)
@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.2.0, current version 5.2.0)
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.2.0, current version 5.2.0)
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.2.0, current version 5.2.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

我已经删除了我系统中的所有旧 Qt 库(或者我想,现在在其他任何地方都找不到 Qt,只有 5.2 安装).有人知道发生了什么吗?

I've deleted all my old Qt libraries that I've in my system (or I suppose to, can't find Qt in anywhere else now, only the 5.2 installation). Anyone has any idea about what's happening?

推荐答案

我在使用 Qt 5.0.1 和 Qt 5.1.0 时遇到了同样的问题.为了修复它,我创建了自己的 macdeployqt 版本.我认为它适用于 Qt 5.2.0.请检查:https://github.com/MaximAlien/macdeployqt.

I had the same problem with Qt 5.0.1 and Qt 5.1.0. To fix it I created my own version of macdeployqt. I think it'll work for Qt 5.2.0. Please check it: https://github.com/MaximAlien/macdeployqt.

这篇关于无法将 Qt Quick 应用程序部署到 Mac OSX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆