I started to learn QT creator. Today I installed it on both Linux and Windows. in Linux, I can compile and execute my ownProgramIn Windows, a problem occurs. When executing the program, the system prompts "mingwm10.dll cannot be found". The solution is to statically compile the QT library.
Steps:
1. Call QT command prompt in the Start Menu,
2. Run configure-release-static-fast.
3 Execute Command mingw32-make
4 Execute Command mingw32-make clean
The above step is the process of compiling the QT static library. It is taken from the blog of the netizen lsyer. Now, some suffixes are generated under the QT \ 2009.03 \ QT \ lib directory. the static library file of A, and then compile your application again, then an error is reported. The error message prompts that qtguid and qtcored cannot be found, change libqtguid4.a and libqtcored4.a In the QT \ 2009.03 \ QT \ lib directory to libqtguid. A And libqtcored. A can also be copied and renamed.
Next, compile your own application. When executing the application hello.exe, the system still prompts that the QT library cannot be found. Later, it is found that the debug version is compiled, as long as you open the projects column on the left, check the release check box and compile it again. The executable file is generated under the release directory: copy the mingwm10.dll in the \ QT \ 2009.03 \ mingw \ bin directory to the release directory and put it together with the executable program. Now the program can be executed normally, no longer prompts that the QT library cannot be found.
1.Modify configuration file(1) Qt creator
Qt 4.3 and newer
Edit <qtdir> \ mkspecs \ win32-g ++ \ qmake. conf:
Change
Qmake_lflags =-enable-stdcall-fixup-wl,-enable-auto-import-wl,-enable-runtime-pseudo-reloc
To (add-static)
Qmake_lflags =-static-enable-stdcall-fixup-wl,-enable-auto-import-wl,-enable-runtime-pseudo do-reloc
(2 ). Visual Studio
See trolltech's KnowledgeBase: Why does a statically built QT use the Dynamic Visual Studio runtime libraries? Do I need to deploy those with my application?
Applications built with msvc depend on msvc *. dll. Following changes must be done to mkspecs in order to eliminate this dependency.
edit \ mkspecs \ win32-X \ qmake. conf, where 'x' stands for the version of Visual Studio: