Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114688

QML application does not start if some QML modules are built static

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.7.0 FF
    • 6.5.1
    • Build System: CMake
    • None
    • Linux/X11, Windows
    • 6c2bb05e6 (6.6), 67d845a02 (6.5), 42b0cb7cc (dev), e1382f6ad (dev)

      I have a QML application that links two QML libraries that we develop ourselves. The libraries are created with qt_add_library(MyQtQuick STATIC) and qt_add_qml_module(MyQtQuick ...). However the application fails to start, with error:

      QQmlApplicationEngine failed to load component ( in ::)
      qrc:/MyQtQuickCellAna/qml/main.qml:149:9: Type FlickableScene unavailable ( in qrc:/MyQtQuickCellAna/qml/main.qml::)
      qrc:/MyQtQuickCellAna/qml/FlickableScene.qml:28:1: module "MyQtQuick" plugin "MyQtQuickplugin" not found ( in qrc:/MyQtQuickCellAna/qml/FlickableScene.qml::)
      

      When I remove STATIC from qt_add_library(MyQtQuick STATIC), everything works and the application starts.

      The reason why I need to build MyQtQuick static is because it links a number of static libraries that are otherwise duplicate defines in the application.

      Some of my specs:

      • Qt: Version 6.5.1 built as a shared library, from sources
      • Platforms: Linux, Windows

      I found possibly related issues:

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            semlanik Alexey Edelev
            emmenlau Mario Emmenlauer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes