QT5.11.1 compile with static

  • Hi,
    Guys,i just installed Qt5.11.1 of windows version on my laptop,application I compiled through Qt5.11.1 can be ran only on my laptop under OS Win10 64 bits,can not run on their PC with platform win10,so I need compile it with static method,it can be released to run on any win10 platform,but I don't know way to static compile QT5.11.1

  • Qt Champions 2017

    Why not just make a deployment folder

    use the Windows Deployment Tool to help copy the needed Dlls.

  • @mrjj Yes, i tried it ,but it does not work,still prompt error that missed some dlls when ran on XP or Win7

  • Qt Champions 2017

    Thats is mostly likely missing compiler run time
    for either mingw runtime or the visual studio runtime.
    Win / and xp dot have vs runtime installed from start, only win 10
    as far as i know.

    Update: seems not even supported.

  • @Sam1990

    Hi! Qt 5.11.1 doesn't support Windows XP and Windows Vista. I use the latest Qt 5.9.6 and it works with Windows Vista fine. Here is the official answer: Windows Vista issue. For static Qt compilation you need to purchase the license to get the paid Qt version.

  • Lifetime Qt Champion

    @Cobra91151 static compilation doesn't require a commercial license, however it comes with licensing constraints that you are not subject to if you have a commercial license.

  • @SGaist

    Hi! So it means that I can compile Qt from the source with static compilation and use it to create projects? Thanks.

  • Qt Champions 2017


    Hi. yes you can use static compilation
    IF your code is Open Source and freely available.
    But if closed source, then you need license. ( or dynamic link)

    To be more exact.
    to obey LGLP , end use must be able to change the Qt version used.
    So you can
    1: provide source
    2: use dynamic linking
    3: provide all .o files used to produce the .exe with static linking.

  • @mrjj

    Hi! I want to create my custom online installer for the projects. I used Inno Setup (Delphi) for that, but with Qt it will be much better. So I only need to make it open source or provide the link to Qt website? Thanks.

  • Lifetime Qt Champion

    If you want to use the LGPL license to keep your code to yourself and use a static version of Qt, you have to provide all the build objects so that your user can re-create the application while linking to the version of Qt they want.

  • @mrjj

    Installer with dynamic linking is not well, because it should be 1 executable, like with Inno Setup. So I can provide the source code or all objects (.obj) files in my case? Thanks.

  • Qt Champions 2017


    Yes that is the general understanding. That should allow end user to use other
    version of Qt. ( not sure How, but in theory)

    However, be much cooler if you could do as open source :)
    (for the installer)

  • Moderators

    @Cobra91151 said in QT5.11.1 compile with static:

    Installer with dynamic linking is not well, because it should be 1 executable, like with Inno Setup

    The installer can still be just one file, but installing software consisting of several files (do you confuse installer and your app?). In my opinion it is way easier to create an installer with dynamically linked Qt as to hack around with own static build of Qt. Did you ever build Qt?

  • @jsulm

    Hi! Yes, I built the Qt several times. I'm not confused. Apps was build with dynamic linking. Also I can build the same way installer and add it for example to zip archive file to distribute. But I can build one executable with Inno Setup and distribute it, which will be much better.

    I can use Qt Installer Framework to build the installer but I want to customize it better. I want to know, how you can build the installer with 1 executable file using dynamic linking? I think it's not possible. Thanks.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.