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

No documentation for building static Qt Quick Application using Qbs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 1.12.0
    • Fix Version/s: 1.13.0
    • Component/s: Documentation
    • Labels:
      None

      Description

      I'm trying to build https://github.com/mitchcurtis/slate/blob/master/app/app.qbs statically so that I can deploy it easily. When using qmake, the application runs fine, but after switching to Qbs, I ran into this error:

      QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3" since plugins are disabled in static builds
      qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
      11:40:57: The program has unexpectedly finished.
      

      I've seen e.g. QBS-1346 and QBS-1121 which have the same error message as me. I added the relevant line from the example in QBS-1121:

      Depends { name: "Qt.qxcb"; condition: Qt.core.staticBuild  && qbs.targetOS.contains("linux") }
      

      That got me a bit further:

      11:51:40: Starting /home/mitch/dev/slate-qt5_slate_static_release-Release/qtc_qt5_slate_static_release_Release/install-root//app...
      QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3" since plugins are disabled in static builds
      loaded library "Xcursor"
      QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5" since plugins are disabled in static builds
      QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1" since plugins are disabled in static builds
      QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1" since plugins are disabled in static builds
      QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QStyleFactoryInterface" since plugins are disabled in static builds
      app.applicationsettings: Loading settings from "/home/mitch/.config/Unknown Organization.conf"
      Previously registered enum will be overwritten due to name clash: QQuickListView.Center
      QQmlApplicationEngine failed to load component
      qrc:/qml/main.qml:176 Type Ui.CanvasContainer unavailable
      qrc:/qml/ui/CanvasContainer.qml:60 Cannot assign object to list property "data"
      
      QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QAccessibleBridgeFactoryInterface" since plugins are disabled in static builds
      11:54:22: The program has unexpectedly finished.
      

      I'm still trying to work out the remaining issues; the QML issue looks like a bug in the QML engine, but there are still lots of warnings about plugins being disabled which doesn't look right.

      Taking a hint from QBS-1346, I've attached plugins.list and qml_plugin_import.cpp.

      I looked at https://doc.qt.io/qbs/howtos.html, but it doesn't mention the "Depends { name: "Qt.qxcb"" stuff. If this is necessary to get statically built applications working, then it should be documented.

        Attachments

        1. plugins.list
          6 kB
        2. qml_plugin_import.cpp
          0.6 kB

          Issue Links

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

            Activity

              People

              Assignee:
              leenam Leena Miettinen
              Reporter:
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes