Results 1 to 20 of 20

Thread: Deploying Qt5 app requires lots of DLL's

  1. #1
    Join Date
    Jan 2012
    Posts
    66
    Thanks
    20
    Thanked 2 Times in 2 Posts
    Platforms
    Windows

    Default Deploying Qt5 app requires lots of DLL's

    I'm porting a relatively simple program from Qt4 to Qt5. I have everything working, but the number and size of the DLL's that are now required to be in my application folder have increased. Whereas before I only needed to put QtCore4.dll and QtGui4.dll into my application folder, now I need those (QtCore5.dll and QtGui5.dll) plus the following:

    icudt49.dll
    icuin49.dll
    icuuc49.dll
    libEGL.dll
    libGLESv2.dll
    QtMultimedia5.dll
    QtNetwork5.dll
    QtWidgets5.dll

    Of those, the only ones that make sense to me are QtMultimedia (I am usng QSound which was in QtGui before, but now is in QtMultimedia), and QtWidgets. I don't use QtNetwork that I know of, and tried adding "QT -= network" to my .pro file, but my executable still complained about missing QtNetwork5.dll if I removed it.

    I have been trying to read about what could be the cause of the other extra dependencies. For example, I have seen that "ANGLE" is enabled by default (http://qt-project.org/doc/qt-5.0/dep...t-windows.html) but I do not use OpenGL or QML and I don't understand how to disable it. I have also read about ICU, but I don't need it (that I know of) so I find it strange that there are 20 MB worth of dll's that seem to be required to run my executable.

    I'd appreciate some feedback on whether or not it is possible to reduce these dependencies. Thanks!

    By the way, I'm using Windows 7 and Qt5 beta 2.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    Lets see.

    No idea why you got the network dependency, maybe dragged in my QtMultimedia?

    OpenGL capabilities are available in QtGui but I believe you can configure Qt to not include that.

    As for ICU, it is now used on all platforms for proper localization support, e.g. locale dependent formatting of dates.
    Most applications will need translation/localizations so I think this is a dependency of QtCore. Might still be possible to configure Qt without if your applications is never used with a different language or in a different locale.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2012
    Posts
    66
    Thanks
    20
    Thanked 2 Times in 2 Posts
    Platforms
    Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    When you say that I could maybe configure Qt without OpenGL, do you mean that I would have to build Qt myself? Or is there something I can put in my .pro file?

    Well, the OpenGL DLL's are only 1 MB, so it's not that frustrating, but the ICU DLL's are about 20 MB's, which triples the size of my whole application for features I don't want.

    There has been much talk about QtWebkit. I wonder if that is what introduces the ICU dependencies. If so, to remove QtWebkit, would I just need to rebuild the Qt library with -no-webkit? I also see a configuration option -no-opengl.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    Quote Originally Posted by wayfaerer View Post
    When you say that I could maybe configure Qt without OpenGL, do you mean that I would have to build Qt myself?
    Yes, that is what I meant. Qt can be highly customized, see e.g. http://doc.qt.digia.com/4.7.1/fine-tuning-features.html


    but the ICU DLL's are about 20 MB's
    I believe that is because of the localization data included in the lib. Unfortunately Windows doesn't ship any ICU itself (unlike OSX or Linux where Qt can use the system ICU).

    which triples the size of my whole application for features I don't want.
    It might be possible to remove localization features, there is QT_NO_TRANSLATION in some files which usually means that is a deactivatable feature.

    There has been much talk about QtWebkit. I wonder if that is what introduces the ICU dependencies.
    Unlikely, translation and localization support is a Qt core feature, not related to QtWebKit at all.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    wayfaerer (21st November 2012)

  6. #5
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    Try with Qt Static build.

    1. Install QtSDK (2009.05)

    2. Open your mkspecswin32-g++qmake.conf file (located in C:\Qt\2009.05\qt\mkspecs\win32-g++\qmake.conf) in an editor like notepad.

    3. Find the line that starts with "QMAKE_LFLAGS = -enable-stdcall-fixup..." and ddd the phrase "-static" (without quotes) after the "=" sign and before the "-enable..." phrase, so it looks like:
    QMAKE_LFLAGS = -static -enable-stdcall...

    4. Save and close this file.

    5. Set your environment variables. Right-click Computer >> Properties >> Advanced System Settings >> Click the "Environment Variables..." button.

    6. Under "User variables," make sure QTDIR is set to your Qt path (C:\Qt\2009.05\qt). Make sure QMAKESPEC is set to win32-g++.

    7. Under "System variables," edit the one called "Path." Add a semicolon ( ; ) to the end, and add the following:
    C:\Qt\2009.05\mingw\lib;C:\Qt\2009.05\mingw\bin;C: \Qt\2009.05\qt\bin

    8. When finished, relog or reboot.

    9. Open a command prompt.

    10. Change to your Qt directory by entering: cd C:\Qt\2009.05\qt

    11. Enter the following: configure -static -no-phonon -no-phonon-backend -release -no-exceptions

    12. When it asks which edition you want to use, enter "o" for open source.

    13. When it asks you to accept the terms of the license, enter "y" for yes. This will take around maybe 10 minutes to complete.

    14. When that finishes, enter the following: mingw32-make sub-src (or) nmake sub-src

    15. Go out to dinner, this will take a while (took between 1-2 hours for me).

    16. When this finishes, open your project in the Qt Creator.

    17. Double-click the project (.pro) file to open it in edit mode.

    18. Add the following line: CONFIG += static

    19. qmake Hello.pro
    nmake release (or) mingw32-make release

    20. Navigate to your release directory and voila! Your standalone executable should be there.

  7. The following user says thank you to Gokulnathvc for this useful post:

    wayfaerer (21st November 2012)

  8. #6
    Join Date
    Jan 2012
    Posts
    66
    Thanks
    20
    Thanked 2 Times in 2 Posts
    Platforms
    Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    That looks very helpful. Thanks! However I don't want to build statically due to licensing issues. Is the process mostly the same for building dynamically?

  9. #7
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    For dynamic building, you need to use exe bundler or the dll's needed. It will be huge. Also you need to copy all those dll's and files to the system that needs this software. Better go for Static building with Open source license. Just a single exe that will do all your needs. Best of luck.

  10. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Deploying Qt5 app requires lots of DLL's

    Quote Originally Posted by Gokulnathvc View Post
    For dynamic building, you need to use exe bundler or the dll's needed. It will be huge. Also you need to copy all those dll's and files to the system that needs this software. Better go for Static building with Open source license. Just a single exe that will do all your needs. Best of luck.
    Building statically will not help much here. It would if you had static versions of all the required libraries in the first place (like all the ICU libraries) and obtaining those requires additional work compared to just rebuilding Qt.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #9
    Join Date
    Oct 2009
    Location
    Texas
    Posts
    15
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt5 app requires lots of DLL's


  12. #10
    Join Date
    Apr 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Deploying Qt5 app requires lots of DLL's

    Hi,

    I'm also wondering the same thing. I've now read the deployment manuals but could not find any clues how to get rid of unnecessary libraries. Nearly everywhere this subject is mentioned like "If you use ANGLE..." or "If you are using ICU...", but I can't find anywhere articles how to exclude those dependencies from my project. I don't want to use ANGLE (Qt5Opengl.dll) or Qt5sql.dll or Qt5Multimedia.dll.

    How to disable/exclude those from my project? Thanks.

    --
    pedro

  13. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Deploying Qt5 app requires lots of DLL's

    Quote Originally Posted by munkeino@hotmail.com View Post
    How to disable/exclude those from my project?
    Don't use libraries that have these components as their dependencies. If you build against only QtCore, your application will not depend on ANGLE. But if you use QtGui, it will.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  14. #12
    Join Date
    Apr 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Deploying Qt5 app requires lots of DLL's

    I looked my .exe with Dependency Walker. Seems like Qt libraries are indeed of need of many other libraries.

    For example I have to use QtWebKit in my project, but I don't use any sql, multimedia (sound etc.) or qml at all. But Dependency Walker shows me that Qt5WebKit.dll is dependent of Qt5Quick.dll, Qt5Multimedia.dll, Qt5Qml.dll and Qt5Sql.dll. This totally sucks.

    Also when I include QtWebkitwidgets.dll it want's me to add also Qt5Opengl.dll which wants me to include Qt5Printsupport.dll along my executable. I don't use any opengl or print functionalities at all.

    So does this mean that I have to surrender and copy all those, I think unnecessary, .dll files to my executable folder because some other .dll files depend on them? Yes those files are not so big but there are so many of them. Also for example Qt5Opengl.dll and Qt5Printsupport.dll files in my application folder looks funny because my application shows only a web page in a dialog.

  15. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Deploying Qt5 app requires lots of DLL's

    Quote Originally Posted by munkeino@hotmail.com View Post
    For example I have to use QtWebKit in my project, but I don't use any sql, multimedia (sound etc.) or qml at all. But Dependency Walker shows me that Qt5WebKit.dll is dependent of Qt5Quick.dll, Qt5Multimedia.dll, Qt5Qml.dll and Qt5Sql.dll. This totally sucks.
    Qt5Webkit is a library providing WebKit for QtQuick. You don't want that.

    Also when I include QtWebkitwidgets.dll it want's me to add also Qt5Opengl.dll which wants me to include Qt5Printsupport.dll along my executable. I don't use any opengl or print functionalities at all.
    You don't but the browser does (for WebGL and printing). If you don't like it, you can always build a custom configuration of WebKit that will not require those.

    So does this mean that I have to surrender and copy all those, I think unnecessary, .dll files to my executable folder because some other .dll files depend on them?
    In theory if you are sure that their code will never be called (e.g. the user will not request WebKit to print anything) you could substitute them with a stub library to reduce the overall size.

    If you are really interested and eagar to minimize dependencies then build a custom version of Qt. If you disable printing and OpenGL altogether during compilation, you will not have to deploy them. If you don't want to spend your time on reconfiguring and rebuilding Qt then it's easiest to just deploy those libraries you don't need. You can use UPX or a similar tool to reduce their size.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  16. #14
    Join Date
    Apr 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Deploying Qt5 app requires lots of DLL's

    Quote Originally Posted by wysota View Post
    Qt5Webkit is a library providing WebKit for QtQuick. You don't want that.
    Hmm... I don't have "Qt += webkit" module at all on my project. For some reason it still wants that.

    I'm using both QWebView and QWebPage. Docs (http://qt-project.org/doc/qt-5.0/qtw...it-module.html) says that they are indeed underneath webkitwidgets. But when I go inside source code of QWebView or QWebPage they both seems to include QtWebKit in their code. Maybe that is the reason my application wants also QtWebKit. Dependency Walker shows that Qt5Webkitwidgets.dll has dependecies to QtWebKit.dll.

    I also noticed that apparently using QWebSettings needs Qt5WebKit.dll.

  17. #15
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Deploying Qt5 app requires lots of DLL's

    Quote Originally Posted by munkeino@hotmail.com View Post
    Hmm... I don't have "Qt += webkit" module at all on my project. For some reason it still wants that.
    It seems webkitwidgets requires it. Unfortunately webkit pulls in quick and sql.

    Maybe an alternative is to not use WebKit at all? Isn't what QTextBrowser supports enough for you?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  18. #16
    Join Date
    Jan 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    Quote Originally Posted by Gokulnathvc View Post
    Try with Qt Static build.

    1. Install QtSDK (2009.05)

    2. Open your mkspecswin32-g++qmake.conf file (located in C:\Qt\2009.05\qt\mkspecs\win32-g++\qmake.conf) in an editor like notepad.

    3. Find the line that starts with "QMAKE_LFLAGS = -enable-stdcall-fixup..." and ddd the phrase "-static" (without quotes) after the "=" sign and before the "-enable..." phrase, so it looks like:
    QMAKE_LFLAGS = -static -enable-stdcall...

    4. Save and close this file.

    5. Set your environment variables. Right-click Computer >> Properties >> Advanced System Settings >> Click the "Environment Variables..." button.

    6. Under "User variables," make sure QTDIR is set to your Qt path (C:\Qt\2009.05\qt). Make sure QMAKESPEC is set to win32-g++.

    7. Under "System variables," edit the one called "Path." Add a semicolon ( ; ) to the end, and add the following:
    C:\Qt\2009.05\mingw\lib;C:\Qt\2009.05\mingw\bin;C: \Qt\2009.05\qt\bin

    8. When finished, relog or reboot.

    9. Open a command prompt.

    10. Change to your Qt directory by entering: cd C:\Qt\2009.05\qt

    11. Enter the following: configure -static -no-phonon -no-phonon-backend -release -no-exceptions

    12. When it asks which edition you want to use, enter "o" for open source.

    13. When it asks you to accept the terms of the license, enter "y" for yes. This will take around maybe 10 minutes to complete.

    14. When that finishes, enter the following: mingw32-make sub-src (or) nmake sub-src

    15. Go out to dinner, this will take a while (took between 1-2 hours for me).

    16. When this finishes, open your project in the Qt Creator.

    17. Double-click the project (.pro) file to open it in edit mode.

    18. Add the following line: CONFIG += static

    19. qmake Hello.pro
    nmake release (or) mingw32-make release

    20. Navigate to your release directory and voila! Your standalone executable should be there.
    It's working only with SDK?
    I am using MinGW 4.9 and Qt 5.4 and I can't make step 11. It's saying that "configure" is not a recognized command.
    I edited qmake.conf and I added the flag. Also, in my project I edited .pro file and I added the required line. I built it successfully. When I run it it's working, but on other computers it's not starting at all. No errors.

    So what I have to do? I have to use SDK? Or what are the steps for my environment?

  19. #17
    Join Date
    Oct 2009
    Location
    Texas
    Posts
    15
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    perhaps you are doing it on the wrong directory. there is one configure.exe in your qt root dir and another one in your qtbase.

  20. #18
    Join Date
    Jan 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    Quote Originally Posted by ferdna View Post
    perhaps you are doing it on the wrong directory. there is one configure.exe in your qt root dir and another one in your qtbase.
    No, is not. I've searched for it.
    But I said before. Maybe I need SDK, but I don't know for sure. That's why I asked Q_Q

  21. #19
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    Are you sure you have a source code distribution of Qt? In my copy of Qt 5.2, there is a "configure.exe" and a "configure.bat" under the qtbase directory. If the EXE does not exist, then the BAT file will bootstrap it from source. You will need a perl installation in order to do that.

  22. #20
    Join Date
    Oct 2009
    Location
    Texas
    Posts
    15
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt5 app requires lots of DLL's

    my suggestion is that you open another thread so they can help you with your problem... this is a totally different issue.

Similar Threads

  1. Vs2008 qmake requires conversion
    By TheGrimace in forum Newbie
    Replies: 7
    Last Post: 7th January 2013, 14:55
  2. Kapture installation requires qmake-qt4
    By saman_artorious in forum Installation and Deployment
    Replies: 0
    Last Post: 10th July 2012, 18:38
  3. using qmake for building app which requires non-qt libs.
    By coding_neo in forum Qt Programming
    Replies: 1
    Last Post: 4th October 2011, 11:37
  4. qt-4.5.0 requires glibc>=2.3.2?
    By mailtome in forum Installation and Deployment
    Replies: 1
    Last Post: 9th April 2009, 04:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.