Win10 + VS2015 under compile Qt5.6.0

Source: Internet
Author: User
Tags windows support

Recently, due to another project needs to use vs2015, so the Qt also upgraded to 5.6.0. Because the project needs to be compatible with Windows XP, you need to compile Qt yourself. Here is a general compilation of the process.

  1. Install Activeperl/python/ruby.
    Activeperl:http://www.activestate.com/activeperl/downloads. The version I'm using is activeperl-5.22.1.2201-mswin32-x64-299574.
    python:https://www.python.org/downloads/. The version I'm using is python-3.5.1-amd64.
    Ruby:https://www.ruby-lang.org. The version I'm using is rubyinstaller-2.2.4-x64. If you don't compile something for a third party, you can use Ruby instead. In fact, I did not use the compile time, just loaded up.
    For convenience, I have installed these directly in the C packing directory (C:\Perl64, C:\Python35, C:\Ruby22-x64).

  2. Install VS2015. This online installation time is very long, slowly wait for it.

  3. Download the Qt source and unzip it to your local directory.
    Here you can choose the right mirror site download: http://download.qt.io/official_releases/qt/5.6/5.6.0/single/ Qt-everywhere-opensource-src-5.6.0.zip.mirrorlist. After the download is complete, unzip to the local directory. The directory I extracted here is E:\qt-everywhere-opensource-src-5.6.0.

  4. Create a new Qt-build.bat file under Qt Source directory E:\qt-everywhere-opensource-src-5.6.0. The purpose of this BAT file is to configure the Qt compilation condition. The contents of my bat file are as follows:
    1 REM********** Initialize env for MSVC CL compiler **********2 SET PATH=c:\windows; C:\Windows\System323 REMSet up \microsoft Visual Studio, where <arch> is AMD64, x86, etc.4 Pager"C:\Program Files (x86) \microsoft Visual Studio 14.0\vc\vcvarsall.bat"x865 6 REM********** Update include & Lib to support XP win SDK 7.1A **********7 SET PATH=c:\programFiles(x86) \microsoft sdks\windows\v7.1a\bin;%PATH%8 SETInclude=c:\programFiles(x86) \microsoft Sdks\windows\v7.1a\include;%include%9 SETLib=c:\programFiles(x86) \microsoft Sdks\windows\v7.1a\lib;%lib%Ten SETcl=/d_using_v140_sdk71_;%cl% One  A REM********** 3rd party build Tools Binaries:ruby, Perl, Python ********** - SET PATH=c:\ruby22-x64\bin; C:\Perl64\bin; c:\python35;%PATH% -  the REM********** Set up QT source env ********** - SET_root=e:\qt-everywhere-opensource-src-5.6.0 - SET PATH=%_root%\qtbase\bin;%_root%\gnuwin32\bin;%PATH% - REMuncomment the below line when using a git checkout of the source repository + REMSET path=%_root%\qtrepotools\bin;%path% - SETQmakespec=win32-msvc2015 + SET_root= A  at REMGenerate Makefile -Configure.bat-confirm-license-opensource-platform win32-msvc2015-Debug-and-release-static-target Xp-prefix D:\QT\QT5.6.0-STATIC-WIN32-VS2015-XP-QT-SQL-SQLITE-QT-SQL-ODBC- Plugin-sql-sqlite-plugin-sql-odbc-qt-zlib-qt-libpng-qt-libjpeg-opengl desktop-qt-freetype-no-qml-Debug-no-angle-nomake tests-nomake examples-skip qtquickcontrols-skip qtquickcontrols2-skip qtsensors-skip Qtdoc

  5. Run cmd, and enter the Qt source directory to run Qt-build.bat.
    E:
    CD E:\qt-everywhere-opensource-src-5.6.0
    Qt-build.bat

  6. After Qt finishes configuring, run NMAKE. And then there's the long wait--it takes about 2 hours on my machine.
    Nmake

  7. After waiting for compilation to complete, run NMAKE install. The compiled files are automatically copied to the directory specified by the-PREFIX directive.

Below is a brief description of the Qt-build.bat file.

    • 1-10 Line is to configure the VC compiler. 6-10 of these lines are enabled for VC support for Windows XP systems. XP is no longer supported by default because of VS 2012. But Microsoft also provides a compilation option to turn on XP support, which is the _using_v140_sdk71_ command. The correspondence under VS2013 is _using_v120_sdk71_. See the settings in VS.


    • 12-21 rows is the environment in which compilation needs to be dependent, make sure that these paths are consistent with the local.
    • The 24 line is the actual configuration command. -CONFIRM-LICENSE-OPENSOURCE Specifies the use of an open source licensing agreement. -platform win32-msvc2015 Specifies the platform to compile, QT-supported platforms can be found in the Qtbase\mkspecs directory. -debug-and-release indicates that the debug and release versions are included. Because I was statically compiled and supported XP,-static and-target XP instructions were included. The-prefix D:\QT\QT5.6.0-STATIC-WIN32-VS2015-XP directive specifies the installation path after compilation is completed, that is, the path to which the compiled library is to be copied when running NMAKE install. Other directives specify which modules to include and which modules to exclude (-skip can exclude modules that you do not need).
    • When I previously compiled the Qt5.5.1 version, my instructions included-skip Qtwebkit. But this time compiling the Qt5.6.0 version is always in the configuration times "attempting to skip Non-existent module Qtwebkit." Later removed-skip Qtwebkit was configured successfully. It seems that Qt5.6.0 does not contain the Qtwebket module by default (I guess, not ^_^).

Finally, attach a link to Qt5 official information about Windows support: http://doc.qt.io/qt-5/windows-support.html.

Win10 + VS2015 under compile Qt5.6.0

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.