Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwenx190 committed Nov 30, 2018
1 parent 1280f31 commit 1213d92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build-static-version-of-qt-with-icu-and-openssl-linked.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@
## Build static version of Qt

1. [Download the latest Qt source code package](http://download.qt.io/official_releases/qt/) and extract it to anywhere you like. I assume you have extracted it to "C:\Qt\src".
2. Open "C:\Qt\src\qtbase\mkspecs\common\msvc-desktop.conf", add "**U_STATIC_IMPLEMENTATION**" to "**DEFINES +=**".
3. [Use the script I offered to generate the batch script file.](https://github.com/wangwenx190/build-scripts/blob/master/win-build-qt.bat), add **-static-runtime** to configure parameters if you want to link to static MSVCRT.
2. 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).
3. [Use the script I offered to generate the batch script file](https://github.com/wangwenx190/build-scripts/blob/master/win-build-qt.bat), add **-static-runtime** to configure parameters if you want to link to static MSVCRT.
4. 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):
```bat
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"
```
**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.

**NOTE**

Expand Down

0 comments on commit 1213d92

Please sign in to comment.