Qt 5.6.0 Dynamic Compilation (VS2013 x86 target XP OpenSSL ICU WebKit)

Source: Internet
Author: User
Tags openssl

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
    1. Visual Studio Ultimate (Express Edition not tested)
    2. Qt 5.6.0 Source Code qt-everywhere-opensource-src-5.6.0
    3. Windows SDK 7.1A (General vs comes with)
    4. OPENSSL-1.0.2G Source Code
    5. The Netwide assembler(nasm-2.12.01-win32) (optional, compile OpenSSL required)
    6. ActivePerl
    7. Python-2.7.11 (https://www.python.org/downloads/)
    8. Ruby (required for compiling webkit)
    9. icu4c 56.1 Source code (required for compiling webkit)
    10. Git (for getting WebKit source code)
    11. 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
    1. Unzip openssl-1.0.2g.tar.gz to C:\Qt\openssl-1.0.2g
    2. Unzip Nasm-2.12.01-win32.zip to C:\Qt\nasm-2.12.01 (optional)
    3. In C:\Qt create an empty directory openssl_shared, the final result of the compilation will be stored in this directory
    4. Open the VS2013 x86 command prompt tool (so that you do not have to manually set the VC compiler environment variables)
    5. 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)
    6. CD C:\Qt\openssl-1.0.2g
    7. Perl Configure Vc-win32--prefix=c:\qt\openssl_shared (if you omit the second step, increase the NO-ASM option)
    8. Ms\do_nasm (if the second step is omitted, execute: Ms\do_ms)
    9. 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)
    10. Modify the mlflags of line 35 lflags and 52, change the/subsystem:console to/subsystem:console ", 5.01" (Support WinXP)
    11. Save, back to CMD, execute: nmake-f Ms/ntdll.mak
    12. 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:

    1. Unzip Icu4c-57_1-src.zip to C:\Qt\icu
    2. Open Icu\source\allinone\allinone.sln with VS2013 and upgrade all items.
    3. Select Visual Studio 2013-windows XP (V120_XP) In Solution Explorer for each project (except Makedata this project): Configuration Properties, general, Platform toolset
    4. 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:

    1. Open cmd, go to C:\Qt\qt-everywhere-opensource-src-5.6.0 (note setting the environment variable for git)
    2. Execution: Git clone git://code.qt.io/qt/qtwebkit.git
    3. Wait for the source code to download, if there is a network error, use a VPN to try again
    4. Execute: Git checkout 5.6.0
V. Compiling QT 5.6.0

  1. Unzip qt-everywhere-opensource-src-5.6.0.7z to C:\Qt\qt-everywhere-opensource-src-5.6.0
  2. Open the VS2013 x86 command prompt tool and execute the following command:
  3. SET _root=c:\qt\qt-everywhere-opensource-src-5.6.0
  4. SET path=%_root%\qtbase\bin;%_root%\gnuwin32\bin;%path%
  5. SET qmakespec=win32-msvc2013
  6. SET _root=
  7. SET include=c:\qt\icu\include;%i Nclude%
  8. SET lib=c:\qt\icu\lib;%lib%
  9. SET path=c:\qt\icu\lib;%path%
  10. SET path=c:\qt\icu\bin;%path%
  11. 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\"
  12. 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:
  13. ".. /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
  14. Enter Y to accept the protocol and wait for configuration to complete
  15. Execution: Jom (performs nmake if JOM is not downloaded)
  16. 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
    1. Qmake_lflags_console =/subsystem:console\ ", 5.01\"
    2. Qmake_lflags_windows =/subsystem:windows\ ", 5.01\"
    3. 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.