Most of the time, we are using QT Creator compiled to run the program we wrote, the program can start normally, but when we directly click on the debug EXE file, the program fails to start, will be prompted missing some DLL files, this is why?
Yes, we have written the QT program, need to use a lot of QT library, but these libraries are in the form of dynamic link library, loaded in the program, if using QT Creator, it will help us to link those needed dynamic link library to the program, but if we manually click EXE file, Then those DLL files cannot be loaded. How to solve it?
There are 2 ways to solve this problem:
1. In the form of an environment variable, place the required DLL file under a folder, then in the environment variable, add the path variable (if there is no path variable), put the address of the folder into the PATH environment variable, so that when the program starts, it can link to those DLL files.
2. Put the required DLL files directly into the QT program directory that you have written. How do I know what DLL files are needed? This can be by clicking on your own EXE file, it will naturally prompt you to missing that DLL, and then add the corresponding DLL file.
When I use the VS2010 compiler and the corresponding QT version, that's it.
When I use Mingw47_32 and Qt5.0.2, when I add up all the DLL files that I have prompted, I get the following error message:
This application have requested the Runtime to terminate it on an unusual.
The reason for this is that the DLL has not been added properly. You need to set up the platforms directory in the directory, and put Qminimal.dll and Qwindows.dll in the platforms two files (all two files under Plugins folder, the other several DLLs are under the bin. ) program to run. The above two DLL files are required because the program runs under the Windows platform.
If not, you also need to add the LibEGL.dll file in the program directory
Experience: With QT Writing program, if it contains a DLL, it is very large, usually more than 10M, really extravagant.
QT Learning 2--qt Release under Window