1. Decompression:
Decompress qt-win-opensource-src-4.3.2.zip to the d: \ QT \ 4.3.2-mingw folder.
When I compile qmake, it is always attached to the pbuilder_pbx.cpp file and cannot be compiled. Therefore, I copied the compiled qmake file to D: \ QT \ 4.3.2-mingw \ bin.
2. Set environment variables:
Set Path = D: \ QT \ 4.3.2-mingw \ bin; D: \ mingw \ bin; % PATH %
3. Generate the MAKEFILE file:
Configure-plugin-SQL-SQLite-plugin-SQL-ODBC-QT-libpng-QT-libjpeg-no-qmake
The "-no-qmake" option is not to compile qmake.
5. compile the project
Mingw32-make
Appendix:
1. Compile the MySQL driver
Because MySQL only provides a library that msvc can use, qt4 for mingw must first compile libmysql required by mingw to compile the qsqlmysql library. you can use the mingw tool (in the package mingw-utils) to generate this file.
Cd c: \ mysql \ Lib \ OPT
Reimp-D libmysql. Lib
Dlltool-K-D libmysql. Def-l libmysql.
The latest reimp command can be downloaded from here.
Cd % qtdir % \ SRC \ plugins \ sqldrivers \ mysql
Qmake-O makefile "includepath + = c: \ mysql \ include" "libs + = c: \ mysql \ Lib \ opt \ libmysql. A" mysql. Pro
Mingw32-make
The libqsqlmysql. A and qsqlmysql. DLL files are generated under the % qtdir % \ plugins \ sqldrivers directory.
For more details about the interoperability between mingw and VC dynamic libraries, see here.
2. Compilation considerations
At least GB of disk space is required for compilation. The compilation time is about 4 hours.
3. After compilation, the temporary file cannot be deleted through the "mingw32-make clean", because this command may delete some library files under the lib directory wrong, a white compilation.
You can only search for the tmp, debug, makefile * and other directories and files under the directory to delete them. The effect is similar.
4. If you want to run the compiled items on another machine, you need to set the configuration file
Create a new file "QT. conf" in the bin directory ".
Write the following content:
[Paths]
Prefix = "D:/QT/4.3.2-mingw1"
Modify the directory location by yourself.