Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Enable QML Plugins in static builds



  • Hello everyone,

    I am trying to deploy a small QML-based application which uses a custom QML Plugin. The application works fine as long as I build it with QtCreator, both in debug and release mode. However, I want to deploy the app as a statically linked executable and I quite don't manage to do so.
    I have compiled my own static version of Qt5.11.1 with the following flags:

    ./configure -prefix $PWD/qtbase -release -static -accessibility -qt-zlib -qt-libpng -qt-libjpeg -qt-xcb -qt-pcre -qt-freetype -no-glib -no-cups -no-egl -no-xinput2 -no-sm -no-icu -nomake examples -nomake tests -make libs -fontconfig -system-freetype
    

    And I could use it successfully to build other statically linked apps (which weren't using any custom QML Plugin though). When I build this application, the process completes without any error, but when I launch the executable (with QT_DEBUG_PLUGINS=1) I get an empty window and the console reads:

    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
    qrc:/app.qml:3:1: module "RDA3" plugin "rda3plugin" not found
    QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QAccessibleFactoryInterface" since plugins are disabled in static builds
    

    I am not sure what can I do in order to enable plugins in static builds. I have tried to apply these suggestions, but they didn't help (btw I am on Linux, CentOS7).
    As said, the exact same code compiles perfectly as a dynamically linked executable, so I hope it's just matter of enabling plugins, as the error message says.

    Let me know which parts of my code I should share to debug this issue, cause I'm a bit lost...


Log in to reply