Qt 5.3.1: DLLs to distribute - which files/folders and why is it not automatic?
Hi guys,
I have just some questions. If I open in QtCreator the standard QtQuick-Application template it compiles and runs from QtCreator without any problems. But starting the *.exe file alone will give you missing dll errors. This is clear to me, and the background is the dynamic linking as far as I understand. But how can I know what I need? Which dlls have to be in the application folder, also I know it needs the /platforms folder with qwindows.dll. But why is this not done automatically? Why do I have to copy all the files in the right place, at least the dlls that are used in all cases - like qwindows.dll or some mingw specific ones - or is there an option I'm missing?
So my question is: What is the exact structure, which dll files do I need on Windows 64Bit with Qt 5.3.1 and MinGW32?
I also read this windows deployment page: http://doc.qt.io/qt-4.8/http://qt-project.org/doc/qt-5/windows-deployment.html
And also this Wiki page, but it seems to be outdated, because QtQuick parts are not in the same folders anymore: Deploy_an_Application_on_Windows
But both pages don't tell me what dll have to be delivered with the application and where to put them exactly. :confused:
Thanks you very much!
AlphaX2
Re: Qt 5.3.1: DLLs to distribute - which files/folders and why is it not automatic?
Generally:
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll
icudt51.dll
icuin51.dll
icuuc51.dll
libgcc_s_dw2-1.dll
libstdc++-6.dll
libwinpthread-1.dll
Plus whatever extra modules you include in your project. Ie: Qt5Network.dll if your build uses the network module etc...
Additionally on windows if you want an icon for your executable you will need qico.dll to be in a folder called "imageformats" with your application.
...and apparently with Qt5 you require:
"platforms/qminimal.dll"
"platforms/qwindows.dll"
"libEGL.dll"
"msvcr100.dll"
"msvcp100.dll"
if you plan to install on another machine.
I know this seems a bit much, it did my brain in when I was trying to release my first application but you get used to it. I build my installers with NSIS, so I just wrote out the list of dlls in an NSIS script once and pretty much copy and paste the list whenever I'm building an installer for a new program.
If you really don't want to go down this road: Read up on building Qt applications statically, it's a bit of a process to rebuild Qt statically but there's instructions on the web on how to do it. Then you can realease your applications without the dlls. That's what I'm planning to do now that I've migrated to Qt5. I'm deploying rather small applications (<1mB) and with Qt5's huge libraries it's excessive to have 40mB of libraries in my installer to download over our poor internet connections in Australia.
As to why this isn't done automatically, I don't know, that's for someone else to answer. On Linux it's not a problem, many Linux distributions have Qt libraries already installed and your application can access them without needing the libs to be in the same directory, but on Win it just seems to be the way it is -_-
Re: Qt 5.3.1: DLLs to distribute - which files/folders and why is it not automatic?
I feel that I should add: I made a static build of Qt today. It is a much easier process now. This page: http://qt-project.org/wiki/How-to-bu...-Windows-MinGW explains how to do it. The documentation seems to suggest that the preferred method of deploying Qt applications on Windows is to use your dynamically linked version of Qt for the development stage and then produce a static build of your application once you're ready to deploy it. This would avoid your DLL troubles entirely. hth