In the mingw environment, compile QT 4.3.2

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.