Why is there no redistribuable runtime ?
I just shared a little program I wrote with some friends, and it was a real pain to get the one using Windows to be able to run it. Tracking all the needed dlls may be quite tricky when some part of Qt depends on other (Webkit depends on phonon and so on), and there are even some dlls I had never heard about (like libgcc_s_dw2-1.dll).
So, my question is : why isn't there a redistribuable runtime that I could tell my friends to download, like there is for vc++ for example ?
This is a good question. I hope there will be. Until that happens you have to send all the dlls to your friends. libgcc_s_dw2-1.dll and mingw10.dll is in the mingw/bin directory.
Qt is the compiler-dependent library that is why there won't be any redistributable packages. If someone will try to create it he will stuck with many problems such as: what dlls should be in the current package? What compilers vendors I should maintain? Thus here would be many(really many) packages if someone try to "help" user in this business. But it would scare end user instead.
This is mostly because you can compile Qt with different compilers.
Traditionally Qt has been compiled with MSVC on Windows(atleast it shows like this to me, I can be wrong too), and Windows redistributes are either unnecessary or people already knows what to do with them...
With MinGW, you need libgcc unless the libgcc is statically compiled into the program, and mingw's dll, which are both found from prebuilt Qt packages. Compiling Qt yourself is only needed if you need customized build of Qt.
Missing dlls can be found simply by testing one's program, without having Qt in the system path... Windows will tell necessary paths.
Well, here comes my opinion:
Qt is a modular library, so most of the time you deploy your app with the two dll's for mingw run-time, and other two for Qt's (core and gui) and there is no reason for your client to install all the dll's, since the application is using only four, so you deploy only with the necessary dll's it's not that hard...
A second reason is that there is possible to be some "incompatibilities" between different versions of Qt (the client may have installed the 4.3 run-time, and you give him an application build with 4.6.3 that use some new features, what happens in this situation?)
Not to mention that some Linux distributions already have Qt!
And i must repeat what others have said, what about if i use some "fancy" new compiler?
I suggest that you don't wait for such "feature" it's unlikely that it will become reality. Better use an installer, and deploy the necessary dll's with your application.
[quote author="Zlatomir" date="1280696835"]
A second reason is that there is possible to be some "incompatibilities" between different versions of Qt (the client may have installed the 4.3 run-time, and you give him an application build with 4.6.3 that use some new features, what happens in this situation?)[/quote]
This is very true, but static versions of those libraries would mean that needed data would be inside the libraries, so this wouldn't be after all a problem... There has been talk about static and shared compilations before in the forum too.
Basically, what the creator of the thread wants, is to have a link that she can give to clients in order to allow them to run the Qt program. But this is something that needs to be handled by programmer, not by framework, because the framework doesn't tell the programmer which compiler should be used. Even though Windows binaries for mingw comes gcc-4.4 only.
@Smar, if you build statically, you don't need any run-time, you will deploy only application (that will include the libraries functionality)
I was talking about (the default) dynamically build (witch is the subject off this topic), and that is only one of the issues that stopped the Trolls to release an run-time redistributable.
That was pretty much my point... Sorry, if it was that hideous, I'm not that good with english.
Together with redistributable package it's necessary to
- create central repository of Qt software.
- force all developers to build software for Qt version corresponding to this repository
- Allow only one repository per Windows distribution with specific lib names.
i.e. Qt4Core.dll - one repo. Qt5Core.dll - another repo.
- Never do major incompatible updates for Qt in such repository.
And there are a lot more details to think about.
It's not impossible task though.
Qt includes a tool get all dependant libraries and plugins for a binary, see windeployqt.exe