【问题标题】:How to bulid a application with QML on MAC OS?如何在 MAC OS 上使用 QML 构建应用程序?
【发布时间】:2022-04-05 19:32:52
【问题描述】:

我尝试在 MAC OS 上使用 QML 构建应用程序。开始构建时出现错误。

Could not parse otool output: "/Users/test/qt/dev/projects/TestProject/build-rproxychecker2-Desktop_Qt_5_15_2_clang_64bit-Debug/debug/ch2.app/Contents/Resources/qml/QtQml/Models.2/libmodelsplugin.dylib.dSYM/Contents/Resources/DWARF/libmodelsplugin.dylib:\n"
Could not parse otool output: "/Users/test/qt/dev/projects/TestProject/build-rproxychecker2-Desktop_Qt_5_15_2_clang_64bit-Debug/debug/ch2.app/Contents/Resources/qml/QtQml/StateMachine/libqtqmlstatemachine.dylib.dSYM/Contents/Resources/DWARF/libqtqmlstatemachine.dylib:\n"
Could not parse otool output: "/Users/test/qt/dev/projects/TestProject/build-rproxychecker2-Desktop_Qt_5_15_2_clang_64bit-Debug/debug/ch2.app/Contents/Resources/qml/QtQml/StateMachine/libqtqmlstatemachine.dylib.dSYM/Contents/Resources/DWARF/libqtqmlremoteobjects.dylib:\n"
Could not parse otool output: "/Users/test/qt/dev/projects/TestProject/build-rproxychecker2-Desktop_Qt_5_15_2_clang_64bit-Debug/debug/ch2.app/Contents/Resources/qml/QtQml/StateMachine/libqtqmlstatemachine.dylib.dSYM/Contents/Resources/DWARF/libqmlplugin.dylib:\n"
...
        "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: string table not at the end of the file (can't be processed) in file:/Users/test/qt/dev/projects/TestProject/buildrproxychecker2Desktop_Qt_5_15_2_clang_64bitDebug/debug/ch2.app/Contents/Resources/qml/QtQml/Models.2/libmodelsplugin.dylib.dSYM/Contents/Resources/DWARF/libmodelsplugin.dylib\n" 
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: string table not at the end of the file (can't be processed) in file:/Users/test/qt/dev/projects/TestProject/buildrproxychecker2Desktop_Qt_5_15_2_clang_64bitDebug/debug/ch2.app/Contents/Resources/qml/QtQml/Models.2/libmodelsplugin.dylib.dSYM/Contents/Resources/DWARF/libqtqmlstatemachine.dylib\n" 
...

我使用 QT 5.15.2、Xcode 10.3、QtCreator 5.0 并且有一个包含这些参数的 .pro 文件。

QT += core gui network sql quickwidgets quick quickcontrols2 
...
lupdate_only {
    SOURCES += qml
}
...
macdeployqt $${DESTDIR}/$${TARGET}.app -qmldir=$${PWD}/qml -always-overwrite;

我尝试在没有 -always-overwrite https://bugreports.qt.io/browse/QTBUG-57265 的情况下调用 macdeployqt,但没有帮助。有人有同样的问题吗?

【问题讨论】:

    标签: macos qt deployment qml


    【解决方案1】:

    如果有人有这个问题。您必须删除所有出现此类错误的文件

    rm -rf "/Users/test/qt/dev/projects/TestProject/build-rproxychecker2-Desktop_Qt_5_15_2_clang_64bit-Debug/debug/ch2.app/Contents/Resources/qml/QtQml/Models.2/libmodelsplugin.dylib.dSYM" 
    rm -rf "/Users/test/qt/dev/projects/TestProject/build-rproxychecker2-Desktop_Qt_5_15_2_clang_64bit-Debug/debug/ch2.app/Contents/Resources/qml/QtQml/Models.2/libmodelsplugin_debug.dylib.dSYM"
    

    最好在 .pro 文件中制作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-16
      • 2016-01-04
      • 2011-07-22
      • 2011-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多