MinGW编译Qt

参考:

http://wiki.batcom-it.net/index.php?title=Building_Qt_on_Windows_%28MinGW%29

http://harmattan-dev.nokia.com/docs/library/html/qt4/install-win.html


测试机器:windows7 x64, mingw32, qt-4.8.5


1) 下载qt的源代码

http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz


2) 下载mingw32工具链

git clone git://code.csdn.net/wuzh1230/bitcoin.git


3) 解压并配置

最好是在干净的代码上做一个git备份,否则qt太大,很难察觉那些文件修改了。

git init . && git add . && git commit -m "add clean sources"


配置:

使用windows的configure.exe执行配置命令,否则qmake会使用Makefile.unix构建,进而失败。


用help看看qt configure options那些事儿

Usage: configure [-buildkey ]
       [-release] [-debug] [-debug-and-release] [-shared] [-static]
       [-no-fast] [-fast] [-no-exceptions] [-exceptions]
       [-no-accessibility] [-accessibility] [-no-rtti] [-rtti]
       [-no-stl] [-stl] [-no-sql-] [-qt-sql-]
       [-plugin-sql-] [-system-sqlite] [-arch ]
       [-D ] [-I ] [-L ]
       [-help] [-no-dsp] [-dsp] [-no-vcproj] [-vcproj]
       [-no-qmake] [-qmake] [-dont-process] [-process]
       [-no-style-