Compiling-ICU-with-MSVC

From Qt Wiki
Revision as of 07:16, 10 February 2015 by Maintenance script (talk | contribs)
Jump to navigation Jump to search

Compiling ICU with MSVC (Microsoft Visual Studio)

Qt 5 / QtWebkit requires ICU.

Pre-built packages

The ICU Project site [site.icu-project.org] provides pre-built packages for MSVC 2010, which should work with compilers too. Anyhow, you have to compile your own version if you want to avoid the MSVC 2010 runtime dependency (because you’re using another MSVC version), or want to tailor the ICU configuration.

download.qt.io [download.qt.io] also hosts packages for MSVC 2010, 2012 and 2013.

Compiling on your own

Requirements

  • MSVC toolchain
  • Cygwin [cygwin.com]

Note: When installing Cygwin and selecting packages, make sure you search for and select ‘make’, ‘dos2unix’ and ‘binutils’.

How to build

Check whether you have e.g. the MSVC compiler (cl.exe) in PATH. If not, set it up by calling 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

Usage

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.

Categories: