Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1674

Can't import dynamic library as QML module

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 1.20
    • Libraries: Qt
    • None

    Description

      When running the attached project, I get:

      qrc:/qml/main.qml:4:1: module "Flint" is not installed
      

      The library's .dll is next to the binary in the install-root folder, so should be found by the QML engine, but because it's missing a qmldir, the engine can't find it. Qbs needs to generate a qmldir like CMake does (and probably also a plugins.qmltypes).

      For example, QtQuick.Templates has these files generated for it:

      Mitch@Mitch-Win10 MINGW64 /c/dev/qt-dev-debug/qtbase/qml/QtQuick/Templates
      $ ls
      plugins.qmltypes  qtquicktemplates2plugind.dll*          qtquicktemplates2plugind.exp  qtquicktemplates2plugind.lib
      qmldir            qtquicktemplates2plugind.dll.manifest  qtquicktemplates2plugind.ilk  qtquicktemplates2plugind.pdb
      

      I can work around it by referencing any symbol from the library in C++ in the app; e.g. including a header and instantiating some class.

      Attachments

        Activity

          People

            kandeler Christian Kandeler
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: