几个星期以来,我一直在与此作斗争,希望有人能找到有用的答案。-我使用QT5.7和QT5.8,这两个版本都出现了错误。
我有一个QtQuick2.0应用程序,它是我在Mac上使用macdeployqt构建的动态链接的.bundle应用程序。
我使用以下参数调用macdeployqt:%{buildDir}/imageDatabase.app -qmldir=%{buildDir}/./UserInterface/-始终覆盖-verbose=2
工作目录是$QTDIR/bin,因为macdeploy需要在QT安装目录中运行,正如我在这里学到的: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"有什么想法吗?
发布于 2017-03-01 03:49:24
我终于在QT论坛上找到了一个解决方案。它看起来像mac部署It有一个严重的错误:https://bugreports.qt.io/browse/QTBUG-57265
您需要在不使用macdeployqt选项的情况下调用-always-overwrite。非常感谢Andy,他在这里发布了这样的信息:https://bugreports.qt.io/browse/QTBUG-57265?focusedCommentId=346168&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-346168
https://stackoverflow.com/questions/42522830
复制相似问题