It is convenient to have a static library linked to your QT application, not only shrinks down the total deliverable size, but also makes the deploy easier. QT official forum recently published a post on how to compile the library, and here is my experience on executing it under Windows 7.
Things you need.
- QT Source Code
- 7-zip
- QT-mingw-32 version, download it here
- Direct X SDK
- Windows Power Shell, if you don't already have it.
- Power Shell Build Script
Steps to build the library
- Install QT-Mingw first, assume it is installed at c:\tools\QT
- Install 7 zip
- Install Direct X SDK,
- Install Power Shell.
- Place qt-everywhere-opensource-src-5.2.x.x.7z under c:\tools
- Place the power shell script under c:\tools
- Edit the build script as follows.
[CmdletBinding()] param( $QtSrcUrl = "C:/tools/qt-everywhere-opensource-src-5.2.1.7z", $QtStaticDir = "C:\tools\Qt\Static", $QtVersion = "", $MingwDir = "C:\tools\Qt\Qt5.2.1\Tools\mingw48_32", [switch]$NoPause = $false )
Lastly, run power shell script, by opening up a power shell window, and type c:\tools\windows-build-qt-static.ps1
The compilation will take a while (about two hours for my Intel I5 machine), and stay tune for part two for static library linking.
Hope it helps.
No comments:
Post a Comment