用VS2015编译Qt5.6.0,WebEngine支持XP

准备工作

1、下载icu库、openssl库

2、安装activePerl、python、git(请将git的bin目录加入path环境变量)

3、修改控制面板->区域->管理->更改系统区域设置->英语(美国)

4、退出360、保持连接网络

5、win10/win8操作系统,vs2015 update3补丁安装

6、下载qt5.6.0源码并解压:

a、修改文件\qtwebengine\src\3rdparty\chromium\third_party\skia\src\core\SkEdge.cpp,找到第231行的fCurveCount = SkToS8(1 << shift);修改为fCurveCount = SkToS8(1i64 << shift);

b、修改\qtwebengine\src\3rdparty\chromium\third_party\ffmpeg\libavformat\wavdec.c,找到第554行修改为

        #if CONFIG_W64_DEMUXER
        if (CONFIG_W64_DEMUXER && wav->w64)
            left = find_guid(s->pb, ff_w64_guid_data) - 24;
        else
        #endif

这个是防止出现ffmeg报 error LNK2001: unresolved external  ff_w64_guid_data 的错误

7、如果你是win10请将C:\Program Files (x86)\Windows Kits\8.1\Lib目录下winv6.3拷贝一份并更名为win8,好像qt5.6.0是基于win8搞的。当然如果你能修改qt源码对应的目录也可以;这个主要是防止报FOLDERID_ApplicationShortcuts未定义的错误。

8、在任一目录建立批处理文件 build5.6.bat,填入以下内容(将等号后面的路径替换成你对应的路径): 
set MSVC_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0
set QMAKESPEC=win32-msvc2015
set QT5_SRC_PATH=D:\QT\qt-everywhere-opensource-src-5.6.0
set QT5_INSTALL_PATH=C:\Qt\Qt5.6
set PERL_PATH=C:\Perl
set PYTHON_PATH=C:\Python27
set RUBY_PATH=C:\ruby-2.3.1
set WIN_FLEX_BISION_PATH=%QT5_SRC_PATH%\gnuwin32\bin
set ICU_PATH=C:\icu
set OPENSSL_PATH=C:\openssl-1.0.1t\win32dll
set PATH=%QT5_SRC_PATH%\qtbase\bin;%QT5_SRC_PATH%\qtbase\lib;%QT5_SRC_PATH%\gnuwin32\bin;%RUBY_PATH%\bin;%PATH%
set PATH=%PATH%;%PERL_PATH%\bin;%PYTHON_PATH%
set LIB=%LIB%;%ICU_PATH%\lib;%OPENSSL_PATH%\lib
set INCLUDE=%INCLUDE%;%ICU_PATH%\include;%OPENSSL_PATH%\include
set PATH=%PATH%;%ICU_PATH%\bin;%OPENSSL_PATH%\bin;%ICU_PATH%\lib
call "%MSVC_PATH%\VC\vcvarsall.bat" x86


REM ********** Update include & lib to support xp win sdk 7.1A **********
SET PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
SET INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE%
SET LIB=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;%LIB%
SET CL=/D_USING_V140_SDK71_;%CL%


cd /D %QT5_SRC_PATH%
call %QT5_SRC_PATH%\configure -prefix %QT5_INSTALL_PATH% -debug-and-release -opensource -confirm-license -platform win32-msvc2015 -c++11 -target xp - opengl dynamic -mp -icu -openssl -nomake examples -nomake tests -no-directwrite
nmake
nmake install
xcopy /y /k "%ICU_PATH%\bin\icudt56.dll" "%QT5_INSTALL_PATH%\bin\"
xcopy /y /k "%ICU_PATH%\bin\icuin56.dll" "%QT5_INSTALL_PATH%\bin\"
xcopy /y /k "%ICU_PATH%\bin\icuuc56.dll" "%QT5_INSTALL_PATH%\bin\"
xcopy /y /k "%ICU_PATH%\lib\icudt.lib" "%QT5_INSTALL_PATH%\lib\"
xcopy /y /k "%ICU_PATH%\lib\icuin.lib" "%QT5_INSTALL_PATH%\lib\"
xcopy /y /k "%ICU_PATH%\lib\icuuc.lib" "%QT5_INSTALL_PATH%\lib\"
xcopy /y /k "%OPENSSL_PATH%\bin\libeay32.dll" "%QT5_INSTALL_PATH%\bin\"
xcopy /y /k "%OPENSSL_PATH%\bin\ssleay32.dll" "%QT5_INSTALL_PATH%\bin\"
xcopy /y /k "%OPENSSL_PATH%\lib\libeay32.lib" "%QT5_INSTALL_PATH%\lib\"
xcopy /y /k "%OPENSSL_PATH%\lib\ssleay32.lib" "%QT5_INSTALL_PATH%\lib\"
pause

需要已编译好的版本请打开连接链接: https://pan.baidu.com/s/14wB4xmFusObPcnXdPwoSWg 提取码: 3hiy

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值