【发布时间】:2017-03-01 03:49:24
【问题描述】:
我已经为此苦苦挣扎了好几个星期,希望有人觉得这很有用或知道答案。 - 我使用 QT 5.7 和 QT 5.8,两个版本都出现错误。
我有一个 QT Quick 2.0 应用程序,我使用 macdeployqt 在 Mac 上将其构建为动态链接的 .bundle 应用程序。
我使用以下参数调用 macdeployqt: %{buildDir}/imageDatabase.app -qmldir=%{buildDir}/../UserInterface/ -always-overwrite -verbose=2
工作目录是 $QTDIR/bin 因为 macdeploy 需要从 QT-Installation 目录中运行,正如我在这里学到的:https://forum.qt.io/topic/59030/solved-macdeployqt-problem/6
当我尝试运行应用程序时出现以下错误:
- 双击:应用程序打开,图标出现在底部的栏中,但除此之外没有任何反应
- 从终端启动应用程序:
输出
Machine:MacOS MyName$ ./tool
QQmlApplicationEngine failed to load component qrc:/main.qml:1 plugin cannot be
loaded for module "QtQuick": '/Users/thorstenbux/DAQRI/gitHub/artoolkit6/Source/Utilities/ImageDBSerialiser/build-ui/imageDatabase.app/Contents/PlugIns/quick/libqtquick2plugin.dylib'
is not a valid Mach-O binary (not a dynamic library)
- 在相关库上调用
file会显示以下内容
Machine:MacOS MyName$ file /Users/myname/client/gitHub/tool/SDK/Applications/tool.app/Contents/PlugIns/quick/libqtquickcontrolsplugin.dylib
/Users/myname/client/gitHub/tool/SDK/Applications/tool.app/Contents/PlugIns/quick/libqtquickcontrolsplugin.dylib: Mach-O 64-bit dSYM companion file x86_64
看起来它正在加载调试库。
macdeployqt 错误信息如下:
ERROR: Could not parse otool output: "/Users/myname/DAQRI/gitHub/tool/Source/Utilities/tool/build-tool-Desktop_Qt_5_8_0_clang_64bit-Release/tool.app/Contents/PlugIns/quick/libqtquick2plugin.dylib:\n"
有什么想法吗?
【问题讨论】: