After many delays, on March 16, QT released the 5.6.0 version (full support for high DPI is undoubtedly a bright spot), starting with the 5.6.0 version, QT directly removes the WebKit module, allowing Webengine as its alternative, but Webengine cannot compile for WinXP (reference: https:// bugreports.qt.io/browse/qtbug-49900). If you still have users still using the WEBKIT,QT official solution on WinXP, you can compile the webkit yourself. Of course, compiling is not always a very easy thing, the author in the compilation process also appeared a lot of problems, but finally can be resolved. This article contains some of the author's experience, hoping to be helpful.
First, prepare
- Visual Studio Ultimate (Express Edition not tested)
- Qt 5.6.0 Source Code qt-everywhere-opensource-src-5.6.0
- Windows SDK 7.1A (General vs comes with)
- OPENSSL-1.0.2G Source Code
- The Netwide assembler(nasm-2.12.01-win32) (optional, compile OpenSSL required)
- ActivePerl
- Python-2.7.11 (https://www.python.org/downloads/)
- Ruby (required for compiling webkit)
- icu4c 56.1 Source code (required for compiling webkit)
- Git (for getting WebKit source code)
- JOM (optional, used instead of NMAKE to compile with all CPU resources)
When installing the Activeperl,python,ruby,git 4 Tools, note the Add executable path to the path option, and avoid adding it manually.
Tips: If some of the download links I recommend do not open, use the X-wall tools like VPN or proxy.
Ii. Dynamic compilation of OpenSSL
- Unzip openssl-1.0.2g.tar.gz to C:\Qt\openssl-1.0.2g
- Unzip Nasm-2.12.01-win32.zip to C:\Qt\nasm-2.12.01 (optional)
- In C:\Qt create an empty directory openssl_shared, the final result of the compilation will be stored in this directory
- Open the VS2013 x86 command prompt tool (so that you do not have to manually set the VC compiler environment variables)
- Set path=c:\qt\nasm-2.12.01;%path% (sets the environment variable for NASM, which can be ignored if no second step is performed)
- CD C:\Qt\openssl-1.0.2g
- Perl Configure Vc-win32--prefix=c:\qt\openssl_shared (if you omit the second step, increase the NO-ASM option)
- Ms\do_nasm (if the second step is omitted, execute: Ms\do_ms)
- Manually edit Ms/ntdll.mak, add option/mp-d_using_v110_sdk71_ in 21 rows of cflag (means to have CL compile and use Windows SDK 7.1A with multithreading)
- Modify the mlflags of line 35 lflags and 52, change the/subsystem:console to/subsystem:console ", 5.01" (Support WinXP)
- Save, back to CMD, execute: nmake-f Ms/ntdll.mak
- When the compilation is complete, execute: nmake-f ms/ntdll.mak install to the openssl_shared directory.
Iii. Dynamic compilation of ICU
after reading the ICU Readme found that the ICU provides a VS2010 solution, so we will open the solution directly with VS2013 to compile, the following steps:
- Unzip Icu4c-57_1-src.zip to C:\Qt\icu
- Open Icu\source\allinone\allinone.sln with VS2013 and upgrade all items.
- Select Visual Studio 2013-windows XP (V120_XP) In Solution Explorer for each project (except Makedata this project): Configuration Properties, general, Platform toolset
- In Solution Explorer, right-click Solution, Build Solution (both debug and release are generated once).
Iv. Obtaining WebKit Source code
qt-everywhere-opensource-src-5.6.0.7z There is no WebKit source code, the author has just begun to try to download 5.5.1 version of the WebKit source, but there was a link error during the compilation process: Link: Fatal error Lnk1104:cannot open file ' \opt:ref.obj ', after a lookup discovery is an escape error in the WebKit configuration file, refer to: https://bugreports.qt.io/browse/ QTBUG-50607, commented that it has been fixed in git. So, use Git to get the source code:
- Open cmd, go to C:\Qt\qt-everywhere-opensource-src-5.6.0 (note setting the environment variable for git)
- Execution: Git clone git://code.qt.io/qt/qtwebkit.git
- Wait for the source code to download, if there is a network error, use a VPN to try again
- Execute: Git checkout 5.6.0
V. Compiling QT 5.6.0
- Unzip qt-everywhere-opensource-src-5.6.0.7z to C:\Qt\qt-everywhere-opensource-src-5.6.0
- Open the VS2013 x86 command prompt tool and execute the following command:
- SET _root=c:\qt\qt-everywhere-opensource-src-5.6.0
- SET path=%_root%\qtbase\bin;%_root%\gnuwin32\bin;%path%
- SET qmakespec=win32-msvc2013
- SET _root=
- SET include=c:\qt\icu\include;%i Nclude%
- SET lib=c:\qt\icu\lib;%lib%
- SET path=c:\qt\icu\lib;%path%
- SET path=c:\qt\icu\bin;%path%
- Modify the C:\Qt\qt-everywhere-opensource-src-5.6.0\qtbase\mkspecs\common\msvc-desktop.conf 74 rows and 75 behavior:/subsystem:console \ ", 5.01\" and/subsystem:windows\ ", 5.01\"
- In C:\Qt\ Create a qt-5.6.0-build-shared and 5.6.0-shared empty directory below, qt-5.6.0-build-shared to build the directory, 5.6.0-shared the installation directory, and then turn cmd to the qt-5.6.0-build-shared directory ( Compiling in this directory is called Shadow Build, which separates the build generated files from the files in the source code directory, you can create multiple other directories, compile with different compilation options, and then execute the following command:
- ".. /qt-everywhere-opensource-src-5.6.0/configure.bat "-prefix C:/QT/5.6.0-SHARED-DEBUG-AND-RELEASE-OPENSOURCE-LTCG- Nomake examples-nomake Tests-skip Qtwebengine-skip Qtwebview-accessibility-plugin-sql-odbc-plugin-sql-sqlite-openg L Dynamic-target xp-largefile-d _using_v110_sdk71_-QT-ZLIB-QT-PCRE-ICU-QT-LIBPNG-QT-LIBJPEG-QT-FREETYPE-QT-HARFB Uzz-rtti-ssl-openssl-mp-i C:\Qt\openssl-shared\include-L C:\Qt\openssl-shared\lib-l gdi32
- Enter Y to accept the protocol and wait for configuration to complete
- Execution: Jom (performs nmake if JOM is not downloaded)
- After the compilation is complete, if there is no error, execute, NMAKE installs, install the built Qt Library to c:/qt/5.6.0-shared (NMAKE install can be executed first: NMAKE docs, generate documents)
Now you can use Qtcreator to add a QT version of the original test, note in the pro file added:
[Plain]View PlainCopy
- Qmake_lflags_console =/subsystem:console\ ", 5.01\"
- Qmake_lflags_windows =/subsystem:windows\ ", 5.01\"
- Defines + = _using_v110_sdk71_
http://blog.csdn.net/kenier/article/details/51064791
Qt 5.6.0 Dynamic Compilation (VS2013 x86 target XP OpenSSL ICU WebKit)