• qt5.6 webengine兼容xp的编译方法


    http://www.qtcn.org/bbs/read-htm-tid-62470.html

    http://stackoverflow.com/questions/31678657/qtwebengine-for-windows-xp-target


    2 down vote favorite
    2
        

    I was trying to build Qt5.5 to be able to run QtWebEngine on Windows XP. Here's my bat file to setup environment:

    REM Set up Microsoft Visual Studio 2013, where <arch> is c amd64, c x86, etc.
    CALL "C:Program Files (x86)Microsoft Visual Studio 12.0VCvcvarsall.bat" x86
    SET _ROOT=%CD%
    SET PATH=%_ROOT%qtbasein;C:Perlin;%_ROOT%gnuwin32in;C:devtoolsBitnami ubystack-2.0.0-26 ubyin;C:Python27;%PATH%
    REM Uncomment the below line when using a git checkout of the source repository
    REM SET PATH=%_ROOT%qtrepotoolsin;%PATH%
    SET QMAKESPEC=win32-msvc2013
    SET _ROOT=

    bat file to configure build

    configure -debug-and-release -nomake examples -opensource -nomake tests -target xp -prefix c:qt55.5msvc2013-winxp

    Build successfull, but I was unable to run any example with QtWebEngineenter image description here

    Is it possible to build QtWebEngine for WinXP target or it incompatible with WinXP?




    Qt WebEngine 5.5.0 for Windows XP compatibility build steps

    PROBLEM WITH OFFICIAL RELEASE

    Qt 5.5.0 oficial release qwebengine module is incompatible with Windows XP applications, even if you force your project binary with XP compatibility compilation/linking settings/flags(QT DLLs are probably still incompatible) and you can exec your exe binary file under XP, you can't use qwebengine module anyway- just because QtWebEnbineProcess.exe is build as invalid EXE for windows XP.

    To make Qt WebEngine 5.5.0 possible to run on winXP you must rebuild Qt modules with additional options way (as as said oficial Qt release is incompatible at all, you must build new one). Under Windows QtWebEngine can be only build only in Visual Studio 2013, there is no possible to build chromium code in another version of Visual Studio. Normally Qt and chromium under Windows can be build with using OpenGL or/and ANGLE project(which uses Direc3D9Ex or Direct3D11) support for hardware graphics operations, if you build for WinXP you have no choose, you must use OpenGL(which is worst choise, if you have choise), because Direct3D9Ex/Direct3D11 are available to install only from Vista+. So make sure you have installed updated graphics drivers for machine where will run your program, because stock XP drivers for your card for OpenGL will be very outdated and perhaps won't work valid.

    PROBLEM GENESIS

    Any problems occur just because default Visual C++ 2013 app compilation is incompatible with XP(C runtime and EXE subsystem), but you can still change and use runtime compatible with WinXP in Visual C++ 2013, this is described there:

    http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx

    so basicly you must add Windows SDK7.1A paths to include, libs and binaries, pass /D_USING_V120_SDK71_ for every cl compiler execution for Qt and chromium and pass /SUBSYSTEM:WINDOWS,5.01 or /SUBSYSTEM:CONSOLE,5.01 for linker invocations while build your project and QtWebEngineProcess.exe, simple isn't it :)

    Build requirements:

        Visual C++ 2013 (in my case installed in stardard location: C:Program Files (x86)Microsoft Visual Studio 12.0)

        Windows SDK 7.1A - last Windows XP compatible SDK, /D_USING_V120_SDK71_ forces to use it (in my case installed in standard location: C:Program Files (x86)Microsoft SDKsWindowsv7.1A)

        3rd party tools, used to build chromium: Git, Perl, Python, pscp.exe- you must add their binaries to PATH env variable before build.

        OpenGL ES SDK to use OpenGL ES 2.0 implementation, I downloaded from AMD (in my case donwloaded to D: zabaqtGLES_SDK).

        Qt 5.5.0 sources- unpacked to D: zabaqtsrc-5.5.0

    (I can't paste more links because I don't have 2 points reputation, OMG! :D)

    Build process

    First read this: http://doc.qt.io/qt-5/windows-building.html, we must do this like there, but few more step is need for XP compatible build.

    Now if source code is unpacked and everything is installed create qt5vars.cmd, in my case it looks like this:

    ************************************************************************
    REM ********** INITIALIZE ENV FOR MSVC 2013 CL COMPILER **********
    SET PATH=C:Windows;C:Windowssystem32
    CALL "C:Program Files (x86)Microsoft Visual Studio 12.0VCvcvarsall.bat" x86
    REM ********** UPDATE INCLUDE & LIB TO SUPPORT XP WIN SDK 7.1A **********
    SET PATH=C:Program Files (x86)Microsoft SDKsWindowsv7.1ABin;%PATH%
    SET INCLUDE=C:Program Files (x86)Microsoft SDKsWindowsv7.1AInclude;%INCLUDE%
    SET LIB=C:Program Files (x86)Microsoft SDKsWindowsv7.1ALib;%LIB%
    SET CL=/D_USING_V120_SDK71_;%CL%
    REM ********** INCLUDE OPENGL DESKTOP GLES SDK **********
    SET PATH=D: zabaqtGLES_SDKx86;%PATH%
    SET INCLUDE=D: zabaqtGLES_SDKinclude;%INCLUDE%
    SET LIB=D: zabaqtGLES_SDKx86;%LIB%
    REM ********** 3D PARTY BUILD TOOLS BINARIES: PUTTY, RUBY, PERL, GIT, PYTHON ********** 
    SET PATH=D:putty;D:Ruby22in;D:Perlin;D:Git;D:Gitin;D:Gitcmd;D:Python27;%PATH%
    REM ********** SETUP QT QMAKE ENV **********
    SET QMAKESPEC=win32-msvc2013
    SET PATH=D: zabaqtsrc-5.5.0qtbasein;D: zabaqtsrc-5.5.0gnuwin32in;%PATH%
    ************************************************************************

    Generally script configures PATH, INCLUDE, LIB env variables for build. In CL env variable can force CL compiler setting, this is main place where we define V120_XP platform usage.

    Now before you start build you must edit some files from sources:

        you must edit file: qtwebenginesrc3rdparty injaconfigure.py find line with: "if platform.is_msvc():" and there you have cl compiler flags, you must remove '/WX' flag, becuse it will fails compilation for sdk7.1. You can also add there '/D_USING_V120_SDK71_' flag, to make sure ninja tool will also define to use V120_xp.

        and you must edit another file: qtwebenginesrcprocessprocess.pro and add there those lines:

    win32: {

    QMAKE_CXXFLAGS += /D_USING_V120_SDK71

    QMAKE_LFLAGS_CONSOLE += /SUBSYSTEM:CONSOLE,5.1

    QMAKE_LFLAGS_WINDOWS += /SUBSYSTEM:WINDOWS,5.1

    }

    you should also add this into your project. This will generate QtWebEngineProcess.exe file compatible with XP. Without this Visual C++ 2013 builds invalid EXE file for winXP.

    If you open command line and call this script now you must cd to qt source directory and call configure, this is my configuration:

    configure -prefix d:[your install path there] -confirm-license -target xp -opensource -opengl desktop -debug-and-release -nomake examples -nomake tests -no-warnings-are-errors

    So I want build debug and release. If you setup everything correctly you should see some compilation process and create Makefiles for qt modules. After that call nmake, compilation makes few hours, and nmake install to copy/install created libraries to prefix. Good luck

    Remember that graphics device must support OpenGL ES 2.0, otherwise after creation QWebView your app will crash by OpenGL driver, or window GUI becomes black. If you want run your app on old machine, you can build Mesa OpenGL software render(I did it and performance is rly slow, few seconds per any refresh window GUI content, but it works) and use it instead hardware driver.
    shareimprove this answer
        
    answered Sep 22 '15 at 8:28
    user5362462
    612
        
            
        
    You have written in the *.pro file: QMAKE_CXXFLAGS += /D_USING_V120_SDK71. But where is the last underscore /D_USING_V120_SDK71_? Also, I've met the following instruction QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01 on the other site. (1) So, which version should I choose - 5.01 or 5.1? (2) Where should I set --single-process if I'd like to debug my program which implicitly calls QtWebEngineProcess.exe? (3) Which 3rd party dlls do I have to deploy (e.g. OpenGL ES SDK)? (4) Is debug version of program able to work with QtWebEngineProcess.exe (mixing release and debug Qt dlls in 1 folder)? – ilya Nov 7 '16 at 7:22
            
        
    Please, add explicit info that this engine does not work with XP since Qt 5.6 :( bugreports.qt.io/browse/QTBUG-49900 – ilya Nov 8 '16 at 18:06
    add a comment
    up vote 0 down vote
        

    You need to use the compiler from Visual Studio 2013, but the headers/libraries from a Windows SDK supporting Windows XP (that's 7.1A):

    "C:Program Files (x86)Microsoft Visual Studio 12.0VCvcvarsall.bat" x86
    set INCLUDE=C:Program Files (x86)Microsoft SDKsWindowsv7.1AInclude;%INCLUDE%
    set LIB=C:Program Files (x86)Microsoft SDKsWindowsv7.1Alib;%LIB%
    set CL=/D_USING_V110_SDK71_

    Note though that QtWebEngine requires a working Qt Quick stack (even QtWebEngineWidgets!), which in turn requires OpenGL. Because OpenGL support on a stock Windows XP is close to non-existent, and ANGLE (the DirectX wrapper) is not working on Windows XP, you need either to make sure there's a decent 3rd party OpenGL driver installed, or fall back to a software opengl32.dll (e.g. from mesa). If you've a Qt license you can also rely on the Qt Quick 2d renderer.
    shareimprove this answer
        
    answered Aug 31 '15 at 13:50
    kkoehne
    624513
        
    add a comment
    up vote 0 down vote
        

    Just open qtwebenginesrcprocessprocess.pro with vs2013, modify to "Visual Studio 2013 - Windows XP (v120_xp)" an rebuild QtWebEngineProcess.exe

  • 相关阅读:
    [转发]深入理解git,从研究git目录开始
    iOS系统网络抓包方法
    charles抓包工具
    iOS多线程中performSelector: 和dispatch_time的不同
    IOS Core Animation Advanced Techniques的学习笔记(五)
    IOS Core Animation Advanced Techniques的学习笔记(四)
    IOS Core Animation Advanced Techniques的学习笔记(三)
    IOS Core Animation Advanced Techniques的学习笔记(二)
    IOS Core Animation Advanced Techniques的学习笔记(一)
    VirtualBox复制CentOS后提示Device eth0 does not seem to be present的解决方法
  • 原文地址:https://www.cnblogs.com/findumars/p/6435635.html
Copyright © 2020-2023  润新知