How to run a Qt-based program on windows

2019-08-11 04:17发布

问题:

Recently, I've written a program using the Qt Creator. It runs well when I execute it using the IDE, but when I want to run the .exe file alone, warnings appear that files like mingw10.dll, QtCore4.dll, etc. are missing from the computer. Does anyone know how can I solve this problem?

回答1:

Take a look at that:

https://stackoverflow.com/a/621337/1758762

If you have built a 'release' version of your program, copy it and the following DLL's from qt\bin to a directory:

QtCore4.dll, QtGui4.dll and mingwm10.dll (if you are compiling with gcc and minGW).



回答2:

You copy those dlls from: MinGW_install\bin and qt_install_path\bin in the same folder with your application.

A cool tool you can use to see what is needed is DependencyWalker

And also you can read more in Qt documentation - they present there the static build too you create a big exe that doesn't need Qt dlls - but note that you have to build Qt yourself and LGPL has some restriction about that (so i guess you can ignore the static build part and read about the plugins deployment there)



标签: qt mingw