QT5 deploying on windows, mingw32
-
[quote author="comanderv" date="1371376430"]
i've figure my friend cann't launch my exec because he's lacking msvc and mingw libs, which is nowhere to find in my QT folder, i'm having him install QT to confirm that.
[/quote]
[quote author="sierdzio" date="1371376680"]You have your compiler in PATH, that is why you don't need those libs on your machine. Forcing your friend to install Qt in that case is more or less pointless.
[/quote]I guess that this is more a windows thing, but the quoted text below had its sense, because of that.
[quote author="koahnig" date="1371232871"]
It tells from where the actual dlls have been loaded and you can check this way that there is no mix up.
[/quote]
[quote author="koahnig" date="1371322539"]
Or you start depends from a cmd-prompt where you have erased all settings of the path environment variable. The latter ensures that have all dlls in the place of your application. You can start it and see that it is working and those dlls.
[/quote]
Cleaning (erasing) out under cmd-prompt helps quite a lot in that respect. -
I have updated the "wiki entry for dependency checking":http://qt-project.org/wiki/Show_library_dependencies#277b62cc3cfe1a1ecfa66f8bd25d7e3f with an example.
Hope that helps :-)
-
yeah as you predicted it was kinda pointless, my friend wasn't able to run the exe, but anyhow i forced him to compile it in QT Creator and he launched it but it still kinda failed due to my ports being closed, as its based on tcp communication - big surprise here ...
i cleared my path var (after running dependency walker - which suggests me to get msjava.dll for my c++ app - ignored it) and surprise surprise, my app still launches on my computer while throwing runtime on my friend's.
and yeah, trolltech is down for a long time but on many forums there are still links to that website, plus harmattan-dev.nokia.com which also 504s or 404s me all the time...
-
I share your frustration on this one, Qt is very easy to get start with, but the deployment is a very difficult/steep learning curve.
From what I was reading (and from my own experience) it sounds strange that you have need for the MSVC libraries. As far as I know the only reason you would need those libraries is if you use the MSVC compiler. If you installed Qt SDK (includes Qt Creator + MinGW + some other stuff) then all the libraries you need will be in the MinGW folders.
Note that you may find multiple copies of certain files, this is because Qt Creator itself uses Qt .dll files (as though it is itself a Qt project). It is important therefore to take only the .dll files from your compiler folder locations. For example "Qt5Core.dll" can be found:
C:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin
or
C:\Qt\Qt5.0.2\Tools\QtCreator\binYou should always select the one under the mingw folder.
Once the right combination of files is achieved (easy, no?) then your "package" should run stand alone.
I also note that you mention that you have only 40mb of .dll files. Just to compare to my project, I have 124mb of .dll files and my project is really basic and possibly similar to yours. I use: QUdpSocket, QThreads, QTimers, XML and a few other basic Qobjects), its a console app so no GUI even!. Here is the list of the dlls that I needed, maybe it gives you some hints?!:
icudt49.dll
icuin49.dll
icuuc49.dll
libgcc_s_sjlj-1.dll
libstdc++-6.dll
libwinpthread-1.dll
Qt5Cored.dll (this is 70mb on its own)
Qt5Newtorkd.dll
Qt5Xmld.dllNote: these are hand-copied so there maybe a type error so don't copy paste to look for them!
I am running my Qt Deployment on wine (for running windows apps under linux if you have not heard of it) under linux so I am pretty sure that everything I need is now with my project.
So summary, a few things to check:
- Why are you using MSVC libs?
- Check the paths that you get your .dll from (make sure they are the correct one)
Hope something in all that helps...
-
[quote author="code_fodder" date="1371454771"]
Qt5Cored.dll (this is 70mb on its own)
Qt5Newtorkd.dll
Qt5Xmld.dll[/quote]You should use release DLLs (not ending with 'd' which stands for debug). They are at least an order of magnitude smaller (QtCore is around 5MB, IIRC).
-
ah ha, thanks :) .... and I still don't have it completely right! :(
-
Those are the dlls I had to add for the installation on windows server (2012 IIRC)
@
01/17/2013 12:42 AM 100,864 libgcc_s_sjlj-1.dll
01/17/2013 12:42 AM 1,062,912 libstdc++-6.dll
01/17/2013 12:42 AM 71,680 libwinpthread-1.dll
02/02/2013 08:02 PM 3,568,640 QtCore4.dll
02/02/2013 09:54 PM 12,981,760 QtGui4.dll
02/02/2013 08:05 PM 1,443,328 QtNetwork4.dll
6 File(s) 19,229,184 bytes
@Qt is compiled with recent MinGW 64 bit compiler.
-
[quote author="code_fodder" date="1371454771"]I share your frustration on this one, Qt is very easy to get start with, but the deployment is a very difficult/steep learning curve.
From what I was reading (and from my own experience) it sounds strange that you have need for the MSVC libraries. As far as I know the only reason you would need those libraries is if you use the MSVC compiler. If you installed Qt SDK (includes Qt Creator + MinGW + some other stuff) then all the libraries you need will be in the MinGW folders.
Note that you may find multiple copies of certain files, this is because Qt Creator itself uses Qt .dll files (as though it is itself a Qt project). It is important therefore to take only the .dll files from your compiler folder locations. For example "Qt5Core.dll" can be found:
C:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin
or
C:\Qt\Qt5.0.2\Tools\QtCreator\binYou should always select the one under the mingw folder.
Once the right combination of files is achieved (easy, no?) then your "package" should run stand alone.
I also note that you mention that you have only 40mb of .dll files. Just to compare to my project, I have 124mb of .dll files and my project is really basic and possibly similar to yours. I use: QUdpSocket, QThreads, QTimers, XML and a few other basic Qobjects), its a console app so no GUI even!. Here is the list of the dlls that I needed, maybe it gives you some hints?!:
icudt49.dll
icuin49.dll
icuuc49.dll
libgcc_s_sjlj-1.dll
libstdc++-6.dll
libwinpthread-1.dll
Qt5Cored.dll (this is 70mb on its own)
Qt5Newtorkd.dll
Qt5Xmld.dllNote: these are hand-copied so there maybe a type error so don't copy paste to look for them!
I am running my Qt Deployment on wine (for running windows apps under linux if you have not heard of it) under linux so I am pretty sure that everything I need is now with my project.
So summary, a few things to check:
- Why are you using MSVC libs?
- Check the paths that you get your .dll from (make sure they are the correct one)
Hope something in all that helps...[/quote]
thanks for the effort man :)
i used the dlls from mingw folder ofcourse, and as far as i have seen on my computer at least when trying to launch my exe all by itself with no libs it started shouting about missing ones, and it never mentioned anything conected to MSVC, in addition it didnt mention some libs it required to launch (neither did Dependecy Walker) ! how i know this? i coppied my exe to mingw folder and run it successfully after which i started a procedure of deleting a lib and trying to launch my exe....and i dont even have a MSVC on my computer but i can launch my app without running qt wheras the same exe with the same libs throws MSVC runtime on friends computer,
and i'm even sure that qt 5.0.2 doesnt include it as my friend installed it and tried runnig the app - failed.another friend acustomed with QT deployment said that runtime is thrown when the libs are either missing or there is problem with versioning... so how come the same framework being installed throwing an error on the same operating system as mine ? he was confused as well...
sorry if im not making sense in some parts, i did drink today...
-
[quote author="koahnig" date="1371459987"]Those are the dlls I had to add for the installation on windows server (2012 IIRC)
@
01/17/2013 12:42 AM 100,864 libgcc_s_sjlj-1.dll
01/17/2013 12:42 AM 1,062,912 libstdc++-6.dll
01/17/2013 12:42 AM 71,680 libwinpthread-1.dll
02/02/2013 08:02 PM 3,568,640 QtCore4.dll
02/02/2013 09:54 PM 12,981,760 QtGui4.dll
02/02/2013 08:05 PM 1,443,328 QtNetwork4.dll
6 File(s) 19,229,184 bytes
@Qt is compiled with recent MinGW 64 bit compiler. [/quote]
and those are the dlls i have to add to run my exe on MY AND ONLY MY computer (xp sp2 -why not.)
@
2013-06-11 10:49 18 025 758 icudt49.dll
2013-06-11 10:49 3 090 303 icuin49.dll
2013-06-11 10:49 1 808 899 icuuc49.dll
2013-06-11 10:57 99 328 libEGL.dll
2013-06-11 10:47 115 200 libgcc_s_sjlj-1.dll
2013-06-11 10:57 968 704 libGLESv2.dll
2013-06-11 10:47 895 488 libstdc++-6.dll
2013-06-11 10:47 68 608 libwinpthread-1.dll
2013-06-11 11:02 4 279 808 Qt5Core.dll
2013-06-11 10:58 3 493 376 Qt5Gui.dll
2013-06-11 10:59 1 130 496 Qt5Network.dll
2013-06-11 11:00 5 210 624 Qt5Widgets.dll
@
the trickiest isliblEGL.dll because neither "missing dll error" nor Dependency Walker mention it but well...sorry for the double post... i cant quote withour using the Quote Link (date thing goes off...)
-
If I was you... I would try a simpler application "just to test that your environment is ok".
What I mean by that is, make the simplest app you can from the "new project wizard thing", in this case a console application (no GUI). Make it do nothing more then the code that is already in there but maybe add a qDebug() << "hello" << endl; in there and then build that for release and test-deploy that.
Your application will not need more then the dlls that I posted (because mine is a console with a few extras), and as mentioned dont use the debug version like I did :o .
If you can deploy that successfully on your friends PC then at least we know the most basic things are working and we can go on from there and maybe identify what additions are not working for you...
Also it might be interesting to see your .pro file, but I would test the simple app first just to see if that works :)
-
simple, console, doing-nothing application works like a charm both on my and my friend's PC.
I used only the libs windows shouted missing while trying to launch exe.so... we know that the method is OK, but when trying the same thing with my little bigger gui app it fails... ideas?
-
It is difficult to say.... you could add in simple instantiations of all the objects you are using one by one until you find that one that is not working then we can see which libraries each requires... painful though :(
What classes are you using? and what libraries (includes) are you bringing in?
-
The icu libs have something to do with unicode according to some post found through Google.
There is also this post.
[quote author="sierdzio" date="1371272019"]Don't forget about copying the platform plugin.
Also, since you mention it - ICU is very likely the cause of your problem. I won't ask you the question you don't want me to ask, but without answering it you probably won't be able to run you application... it's your choice.[/quote]
Are you using unicode?
Is it really necessary to use?The optimum would be that you do not need it and it is easy to eliminate the dependency.
Typically depends.exe shows all dll dependencies and lately some more than actually. It seem to be less a problem of depends.exe than more of the moving target windows. If it would fail to show missing dlls as well, the tool would be completely useless by now. Well, may be not completely, since you would get some part of the functionality.
If you follow unicode in the Qt documentation you find "some specifics for windows":http://qt-project.org/doc/qt-5.0/qtdoc/internationalization.html#windows
So my conclusion is either you are using unicode in some third party module or in your own, but not the Qt unicode. If you use Qt unicode, it should be in one of the Qt dlls.