gpt4 book ai didi

c++ - QT Quick (QML) assemble mac-.bundle -> 使用 macdeployqt 时不是动态库错误

转载 作者:行者123 更新时间:2023-11-30 02:26:36 25 4
gpt4 key购买 nike

我为此苦苦挣扎了数周,希望有人觉得这有用或知道答案。- 我使用 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 显示以下内容

机器:MacOS MyName$ 文件/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 位 dSYM 配套文件 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"

有什么想法吗?

最佳答案

我终于在 QT 论坛上找到了解决方案。看起来 macdeployqt 有一个严重的错误:https://bugreports.qt.io/browse/QTBUG-57265

您需要在没有-always-overwrite 选项的情况下调用macdeployqt。非常感谢 Andy Shaw 在这里发帖: https://bugreports.qt.io/browse/QTBUG-57265?focusedCommentId=346168&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-346168

关于c++ - QT Quick (QML) assemble mac-.bundle -> 使用 macdeployqt 时不是动态库错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42522830/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com