Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
standalone Windows app using mingw
Working on my first QT project has been both fun and frustrating. I am using the latest build of QT and only installed the mingw side (plus of course the UI side). My program seems "stable" enough to begin experimenting with a release standalone so I can test on my other windows 7 x64 machines and have a few friends play with it so that I know I have a solid base to continue tweaking and adding some features.
I changed the project to a release build, and of course runs fine in the QT side. Trying to just run the exe from the build folder, and I'm sure you all know the problems. Running the exe, errors came up about missing DLL's, so I ended up copying about 5 of them into the release folder. Then there was another fatal error so I did some more internet digging and forum reading, and also read the local machine doc html file 'configure-options'. Many of the posts I found were years old (a lot of them 8 years) and I admit I am majorly confused. My .pro file has:
CONFIG += c++11
CONFIG += static
but of course that made no difference. There is talks about using "configure.bat" in windows but there is no configure executable or batch file within my QT 5.12 installation.
This program I am doing will probably be the only one I create in QT and the plan is to make it totally open source once I am done. Because this is based on using WinPCap, it will only ever run on a windows machine. No android, no web, no database stuff...
My goal is to have everything within the release EXE file rather than including various DLL's. I know, larger exe but that's fine for me. So with that said, can someone please tell me exactly what I need to do to accomplish this?
Thanks kindly in advance.
koahnig last edited by
The dll versions of application in connection with Qt is basically standard since the pre-built version are only dynamic link. This is because of license issues and the LGPL.
You can build also Qt Gui and other Qt applications based on static libraries, but than you have to careful that you are not infringing the licenses. In order to be able to do so, you need to build the set of Qt libraries yourself as static. Just a simple statement as
CONFIG += static
is not sufficient.
In order to package your application you need to collect the required libraries.
For instance you can use windeployqt http://doc.qt.io/qt-5/windows-deployment.html .
Here you find also another discussion about shared vs static libraries http://doc.qt.io/qt-5/deployment.html
Pablo J. Rogina last edited by
My goal is to have everything within the release EXE file rather than including various DLL's.
What could be the problem of providing your friends with a .zip file containing all the required files (i.e. .exe + .dlls) that they unzip into a folder and run from that location?
@koahnig thanks for the information.. I did the windeployqt and it added in 5 folders and 8 dll's. I suspect there may be more to do though because when I tried to run the exe in the release folder it said it couldn't start because libgcc_s_seh-1.dll was missing. It was in the mingw folder so I copied that. Then said libwinpthread-1.dll was missing, copied that, same with libstdc++-6.dll ... (guess windeployqt missed those? shrug)
Anyway, after that, the exe did run, so... thankful for that :)
@Pablo-J.-Rogina yes, I was just trying to be "nice" to folks... now that the exe runs within windows, I'll have to zip up the files and stick them on the other machine. As for the pcap file(s)... I'll leave those out and see what complaints I get on the other machine. Always nice to know stuff. I have it installed on my system because I use WireShark from time to time.. If it fails to run (most likely) then I will install winpcap on the other machine and try again. And if that fails, then I might have to copy the lib and/or dlls and see what happens.
as expected, the other system complained about winpcap being missing so I went to the site and downloaded the installer, installed it, set to load driver at boot, rebooted.
The program does run. Not sure why but the other machine is only displaying a few packets compared to running the exe on the main system. Interesting to note that winpcap is now 'dead', and they want people to use npcap instead. I should probably convert over to that due to the win10 (yuk) support.