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

Qt Quick static compilation?



  • Does Qt Quick program support statically compiled single file .exe program? In addition, does the statically compiled program of QtWidget program and Qt Quick program do not rely on any external libraries under the window platform (there is no prerequisite for calling external libraries inside the program)?


  • Lifetime Qt Champion

    Hi
    Qt can be statically compiled including Qt Quick.
    However, this requires a commercial license if you plan on distributing the
    exe and you want your app to be closed source.

    Yes a compiled Qt has all its Qt DLLs compiled into the exe so nothing else
    is required.

    https://decovar.dev/blog/2018/02/17/build-qt-statically/

    Do note is not always easy to get it all working statically. It requires a good understanding of the toolchain. also, make a huge cup of tea/coffee as unless you have a powerful cpu it can take hours to compile. :) Remember to use the -j option to use all cores.


  • Lifetime Qt Champion

    Hi,

    @mrjj said in Qt Quick static compilation?:

    However, this requires a commercial license if you plan on distributing the
    exe and you want your app to be closed source.

    It's a bit more complex than that with regards to the LGPL. The program user shall be able to relink to a different version of Qt they want. This implies providing the exact build artifacts of the executable which is way more complicated than using an installer framework to pack everything needed.

    Hence the usual way is to use the dynamic build if not having a commercial licence.


Log in to reply