Compiling-ICU-with-MinGW
Compiling ICU with MinGW
Qt 5 / QtWebkit requires ICU, which MinGW distributions do not ship.
Pre-built packages
The ICU Project site [site.icu-project.org] provides pre-compiled libraries for both 32 and 64 bit. However, these depend on the Microsoft Visual C++ 2010 runtime being installed.
download.qt.io [download.qt.io] also hosts packages for the MinGW toolchains Qt ships.
Compiling on your own
Requirements
- MSYS command prompt (an sh shell + some UNIX tools, get it from http://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.11/MSYS-1.0.11.exe/download?use_mirror=garr. It’s also an (optional) part of mingw.org installer.)
- Working MinGW, or MinGW-w64 toolchain
How to build
- Download latest ICU4C source code from http://site.icu-project.org/download (e.g. icu4c-52_1-src.zip), unzip
- Start a MSYS command prompt (C:\msys\1.0\msys.bat)
Check that gcc is in PATH, otherwise add it, e.g.
Run configure && build:
This will generate a release shared build that you can use in both a debug and release build of Qt.
To link ICU statically (e.g. for a static release build of Qt), you have to append ‘—enable-static —disable-shared’ :
To link ICU statically and build it in debug mode (e.g. for a static debug build of Qt), you have to prepend ‘—enable-debug —disable-release’ to the arguments:
Finally, run make && make install
Using it
Add the include, lib folders to your compilation environment, e.g. for cmd.exe :
When you now run Qt’s configure.exe ICU should be detected, and Qt links against the libraries.