1. Conditions of Use:
(1) System: Widows XP Radish version
(2) qt:qt4.6.2 Windows edition
2. Use steps:
(1) Statically compiling QT
A: Set qmake.conf
Use Notepad to open the qmake.conf under d:\qt\2010.02.1\qt\mkspecs\win32-g++
Add "-static" after "Qmake_lexflags =" and save exit.
B: Run, "Start---program---Qt SDK by Nokia v2010.02.1 (open source)---
Qt command Prompt, open a command terminal.
C: Configure the compilation parameters by typing the following command:
Configure-static-release-no-exceptions
Start configuring Qmake, license with LGPL
D: Use the following command to statically compile the QT library:
Mingw32-make SUB-SRC
3. Remove the various library files dependent methods:
Using static versions of MinGW and GCC
Static version of the download address:
http://code.google.com/p/qp-gcc/
FileName: Mingw-static-4.4.5-all
Extract the above file: Direct coverage: D:\QT\2010.02.1\MINGW files
4. Modify the following folder D:\Qt\2010.02.1\qt\qmake:
Makefile* A total of four files:
Change the "lflags =" to: "Lflags=-STATIC-LIBGCC"
5. When debugging the program: Use the Qtcreator Debugy method.
When you publish a program: Use the Qtcreator release method. You can run your application on a computer that does not have QT.
This article from "LINUXQT Jinan high-tech Zone" blog, please be sure to retain this source http://qtlinux.blog.51cto.com/3052744/568619
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/cplus/