I've been working with Qt for a while now (started with Qt4, now using Qt5) with MinGW for Windows and I'd like to have my software portable (to make it available for Linux, too). One thing I noticed about Qt5's DLLs (and its dependencies), is that they are quite large. My core application might be not even 1 MB, where as all the DLLs needed (Qt5 core+gui+widgets, icu DLLs, libgcc_s_dw2-1.dll, libstdc++-6.dll, libwinpthread-1.dll and platform DLLs such as qwindows.dll) have a size of 40 MB and more, that's 40 times more than the actual application. Now there are several ways to deal with it, and I have also searched the internet and there are finally some possibilities, which I'd like to list here and to ask you about your oppinions:

  1. Static Linking - This is a method that if often suggested due to my issue.
    • Pro - (relatively) small executable to deploy
    • Con - Difficult to compile on Windows; Qt code is re-used in all my Qt applications, which will make the final size even larger (when using several Qt applications)
  2. Install DLLs in system directory - Install the DLLs in some system directory, such as C:\Windows\system32.
    • Pro - Any Qt application, compiled with the same compiler and using the same Qt/MinGW version share the same DLLs.
    • Con - If the Qt applications are removed, the DLLs might still remain unused in the system directories; incompatible with Qt applications compiled with other compilers or possibly even using other Qt minor versions
  3. Ship with each application
    • Pro - No version issues, the app is shipped with that DLLs (and the versions of them), it really depends on; is easily be removed on uninstalling the application
    • Con - Quite large: roughly 40 MB more space for each Qt application, even is they are all by the same developer
  4. Share with developer's applications - A directory of the developer (such as C:\Program Files\Developer's Name\lib\*.dll), that is used by all Qt applications of that developer.
    • Pro - Running the Qt application (installed in some other directory, such as C:\Program Files\Developer's Name\app) with a batch script, that temporary adds the lib directory to the PATH environment variable when starting the application, all Qt applications of that developer can share the DLLs
    • Con - Difficult to maintain (proper cleanup on uninstalling all Qt applications); installers must still include all DLLs in case of the user hasn't installed any Qt application of that developer yet.


Please tell me what you think about each of these way and which one you would prefer or if you know even another way for deploying the apps for Windows.