Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Building Qt-4.8.7 and qtwebkit-2.3.4 separately with VS2012 on Windows
Forum Updated to NodeBB v4.3 + New Features

Building Qt-4.8.7 and qtwebkit-2.3.4 separately with VS2012 on Windows

Scheduled Pinned Locked Moved Installation and Deployment
qtwebkitvs2012windowsbuilding
4 Posts 2 Posters 4.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kylinsage
    wrote on last edited by kylinsage
    #1

    Building Qt on Windows is quite a difficult work, while the work on OS X and Ubuntu is really simple. The main problem is QtWebKit. Official release provides precompiled Qt4 SDKs for VS2010 but not VS2012; project qt64ng on http://sourceforge.net/projects/qt64ng/ also provides Qt4 SDKs for VS2012 and VS2013, but not detail building steps.

    Tutorials on internet provide some instructions on building Qt-4.8 with VS2012, but the generated QtWebKit4.dll doesn't work, encountering error StackHash_0a9e (tested on Win7 and Win10). This tutorial focus on details of building Qt-4.8.7, qtwebkit-2.3.4 and qtcreator-2.8.1.

    Preparations

    Install Visual Studio 2012 Express for Desktop
    Use tool 'Developer Command Prompt for VS2012' for following jobs.

    Install perl
    http://www.activestate.com/activeperl

    Build OpenSSL
    Download source code: http://www.openssl.org/source/openssl-1.0.2d.tar.gz
    Decompress to directory: C:\Users\username\Downloads\openssl-1.0.2d
    Compile and install(installing directory: C:\OpenSSL)

    cd C:\Users\username\Downloads\openssl-1.0.2d
    perl Configure VC-WIN32 no-asm --prefix=C:\OpenSSL
    ms\do_ms
    nmake -f ms\ntdll.mak
    nmake -f ms\ntdll.mak install

    Append C:\OpenSSL\bin to system path

    Build Qt-4.8.7 without qtwebkit(-no-webkit)

    Change work directory to Qt source root directory, and run:
    configure -mp -prefix C:\Qt\4.8.7 -release -confirm-license -opensource -qt-zlib -qt-libjpeg -qt-libpng -qt-libmng qt-libtiff -no-qt3support -no-webkit -nomake demos -nomake examples -openssl -I C:\OpenSSL\include -L C:\OpenSSL\lib

    Compile Qt source:
    namke
    (It takes about 2hr to finish compiling.)

    Install Qt SDK:
    namke install

    Append C:/Qt/4.8.7/bin to system path

    Build QtWebKit-2.3.4

    Download source code from
    http://download.kde.org/stable/qtwebkit-2.3/2.3.4/src/qtwebkit-2.3.4.tar.gz
    Note that the lastest WebKit source code from webkit.org doesn't support .

    Install necessary tools for building qtwebkit:

    GNUWIN32
    http://sourceforge.net/projects/gnuwin32/
    or from gnuwin32 in Qt-5.5.0 source code directory

    python
    https://www.python.org/ftp/python/2.7.10/python-2.7.10.msi

    ruby
    https://www.ruby-lang.org/en/downloads/

    perl(already installed)
    http://www.activestate.com/activeperl

    Make sure binaries directories of above tools are in system path.

    sqlite source code
    http://sqlite.org/2015/sqlite-amalgamation-3081101.zip
    Decompress it to:
    C:\Users\username\Downloads\sqlite3

    Compile qtwebkit:

    set SQLITE3SRCDIR=C:\Users\username\Downloads\sqlite3
    set QTDIR=C:\Qt\4.8.7
    perl Tools\Scripts\build-webkit --qt --release

    It takes about 4hr to finish compiling.

    Install QtWebKit:

    cd WebKitBuild/Release
    nmake install

    Test QtWebKit

    In fact,after buidling QtWebKit,a test program called QtTestBrowser.exe is located in WebKitBuild/Release/bin directory.

    Your can also build project browser in Qt source directory(say %QTSRC%/demos):

    cd %QTSRC%/demos/browser
    qmake
    nmake

    Building QtCreator-2.8.1 with Qt-4.8.7 and MSVC 2012

    cd %QTCREATORSRC%
    qmake CONFIG+=release qtcreator.pro
    nmake
    namke install INSTALL_ROOT=C:\Qt\qtcreator-2.8.1

    You will encouter following errors:
    c:\users\username\downloads\qt-creator-2.8.1-src\src\libs\utils\consoleprocess
    _p.h(49) : fatal error C1083: Cannot open include file: 'private\qwineventnotifi
    er_p.h': No such file or directory
    winutils.cpp
    Generating Code...
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 11.0\VC\BI
    N\cl.EXE"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 11.0\VC\BI
    N\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.

    The reason is that some headers haven't been installed, you should copy headers in directory
    C:\Users\username\Downloads\qt-everywhere-opensource-src-4.8.7\src\corelib\kernel
    to
    C:\Qt\4.8.7\include\QtCore\private

    then, run nmake to continue.

    Enjoy Qt built by yourself!

    References

    http://www.linuxfromscratch.org/blfs/view/svn/x/qt4.html
    http://trac.webkit.org/wiki/QtWebKit
    http://trac.webkit.org/wiki/BuildingQtOnWindows

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You should rather create a wiki article with your guide, it will be easier to find there

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        You should rather create a wiki article with your guide, it will be easier to find there

        K Offline
        K Offline
        kylinsage
        wrote on last edited by
        #3

        @SGaist
        I'm a newbie to this forum. Would you please give me some instructions on how to create a wiki article? Thank you!

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The wiki is located here and you should have everything explained there

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved