For Windows platform and VS developers ONLY !!!
You have to install Active Perl, Python 2 and Visual Studio first.
From ICU 64, it requires Python 3 to be built.
32-bit example:
- Download the latest MSYS2 and install it. I assume you have installed it to it's default location "C:\msys64".
- Open MSYS2 MSYS shell and execute the following commands:
Close the shell window forcely and open MSYS2 MSYS shell again, execute the following commands:
pacman -Syu
pacman -Su pacman -S make binutils python3
- Rename "C:\msys64\usr\bin\link.exe" to "link.exe.bak" (only if you have this file).
- Download the latest ICU source code package and extract it to anywhere you like. I assume you have extracted it to "C:\ICU\src".
- Open cmd shell and execute the following commands (I assume you have installed VS2017 Community to it's default localtion "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"):
Then execute the following commands:
REM 64 bit: use "x64" instead of "x86" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 REM 64 bit: use "-mingw64" instead of "-mingw32" call "C:\msys64\msys2_shell.cmd" -mingw32 -use-full-path
ICU will link to shared MSVCRT(-MD) for both shared and static builds by default, if you want to link against static MSVCRT, addcd /C/ICU/src/source ./runConfigureICU MSYS/MSVC --enable-static --disable-shared --prefix=$PWD/../../icu4c-x86-static-msvc2017 make -j4 && make install
CFLAGS=-MT CXXFLAGS=-MT
to the configure parameters.
Just use the script I offered.
- Download the latest Qt source code package and extract it to anywhere you like. I assume you have extracted it to "C:\Qt\src".
- Open "C:\Qt\src\qtbase\mkspecs\common\msvc-desktop.conf", add "U_STATIC_IMPLEMENTATION" to "DEFINES +=" (this step is for static version of ICU only, if you don't need ICU, please ignore this step).
- Use the script I offered to generate the batch script file, add -static-runtime to configure parameters if you want to link to static MSVCRT.
- Open the generated .bat file, add the following lines to it and put them to their proper position (you may have to change a little bit if necessary):
NOTICE: -lAdvapi32 is necessary for static version of ICU, without this lib, the compilation will fail. -lgdi32 is the same. Don't remove the two libs.
SET "_ICU_DIR=C:\ICU\icu4c-static" SET "_OPENSSL_DIR=C:\OpenSSL\openssl-static" SET "PATH=%_ICU_DIR%\bin;%_OPENSSL_DIR%\bin;%PATH%" CALL "configure.bat" -icu -I "%_ICU_DIR%\include" -L "%_ICU_DIR%\lib" ICU_LIBS="-lsicudt -lsicuin -lsicuuc -lAdvapi32" -openssl-linked -I "%_OPENSSL_DIR%\include" -L "%_OPENSSL_DIR%\lib" OPENSSL_LIBS="-llibcrypto -llibssl -lgdi32"
NOTE
If you have compiler errors and the whole compiling process stopped, don't worry, it's OK, just close the batch script window and rerun it.