Important: Please read the Qt Code of Conduct -

[Solved] Static Build doesn't run on other PCs (Windows)

  • Hi all,

    I have tried creating static builds of my application that I can run on other PCs that don't have Qt installed (the whole point of a static build...)

    While I can build my application, and it runs fine on my Windows 7 Machine, it does not run on other computers.
    Well, it does run (the process shows up in the Task Manager), but no window appears.

    I'm using the C++ portion of my application only start up QML. The rest is all done in QML.

    Now, when I complied Qt 5.4.0, I used the following options:

     configure.bat -static -debug-and-release -platform win32-g++ -prefix 5.4.0-static -opengl desktop -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests

    My main.cpp looks like this:

    #include <QApplication>
    #include <QQmlApplicationEngine>
    #include <QQuickView>
    #include <QtQml>
    int main(int argc, char *argv[])
        QApplication app(argc, argv);
        QQmlApplicationEngine engine;
        return app.exec();

    If that makes any difference, in the QML code, I include items like:

    import QtQuick 2.4
    import QtQuick.Layouts 1.1
    import QtQuick.Controls 1.3
    import QtQuick.Window 2.2
    import QtQuick.Dialogs 1.2

    But, yes, as mentioned below, I can build this, and it works on my PC.
    On other PCs, I can see the process running in the Task Manager, but the Application Window does not appear.

    Any pointers in where I go wrong are appreciated!

  • As it turns out, I needed to add the "QtQuick" and "QtQuick.2" folders in the same directory as my *.exe file.

    This wiki page brought me on the right path.