QT Quick(QML)组装mac-.bundle->使用macdeployqt时不是动态库错误 [英] QT Quick (QML) assemble mac-.bundle -> not a dynamic library error when using macdeployqt
问题描述
我已经为此苦苦挣扎了几周,希望有人能发现这个有用或知道答案. -我使用QT 5.7和QT 5.8,并且两个版本均出现错误.
I struggle with this for weeks now and hope someone finds this useful or knows an answer. - I use QT 5.7 and QT 5.8 and the error occurs on both versions.
我有一个QT Quick 2.0应用程序,我使用macdeployqt在Mac上将其构建为动态链接的.bundle应用程序.
I have a QT Quick 2.0 application which I build as a dynamically linked .bundle application on a Mac using macdeployqt.
我使用以下参数调用macdeployqt: %{buildDir}/imageDatabase.app -qmldir =%{buildDir}/../UserInterface/-always-overwrite -verbose = 2
I call macdeployqt with the following parameters: %{buildDir}/imageDatabase.app -qmldir=%{buildDir}/../UserInterface/ -always-overwrite -verbose=2
工作目录为$ QTDIR/bin,因为需要在QT安装目录内部运行macdeploy,如我在此处了解到的:
The working directory is $QTDIR/bin because macdeploy needs to be run from inside the QT-Installation directory as I learned here: https://forum.qt.io/topic/59030/solved-macdeployqt-problem/6
当我尝试运行应用程序时发生以下错误:
The following error occurs when I try to run the application:
- 双击:该应用将打开,并且该图标显示在底部的栏中,但除此之外什么也没有发生
- 从终端启动应用程序:
输出
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
会显示以下内容 - Calling
file
on the library in question reveals the following
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
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
看起来正在加载调试库.
looks like it is loading the debug libraries.
macdeployqt错误消息如下:
macdeployqt error message is the following:
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"
有什么想法吗?
推荐答案
我终于在QT论坛中找到了解决方案.似乎macdeployqt有一个严重的错误: https://bugreports.qt.io/browse/QTBUG-57265
I finally found a solution in the QT forums. It looks like the macdeployqt has a severe bug: https://bugreports.qt.io/browse/QTBUG-57265
您需要不带-always-overwrite
选项的情况下调用macdeployqt
.
非常感谢Andy Shaw在此处发布的内容:
You need to call macdeployqt
without the -always-overwrite
option.
Many thanks to Andy Shaw who posted that here:
https://bugreports.qt.io/browse/QTBUG-57265?focusedCommentId=346168&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-346168
这篇关于QT Quick(QML)组装mac-.bundle->使用macdeployqt时不是动态库错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!