Tuesday, July 5, 2016

Possible Errors during the build process for Qt5.6 + QtWebKit with MSVC 2015.

Do not panic when you encounter any of these errors. The good news is that you do not have to start the build process from scratch again with a fresh copy of qt5.6/qtwebkit source. Just follow the steps below to fix the error and run nmake && nmake install again (or jom if you are using jom). The build process will continue from where it stopped.

1. Open SSL Error;

qsslcertificate_openssl.cpp
qsslcontext_openssl.cpp
ssl\qsslcontext_openssl.cpp(473): error C2039: 'tlsext_tick_lifetime_hint': is not a member of 'ssl_session_st'
C:\openssl-win32\include\openssl/ssl.h(423): note: see declaration of 'ssl_session_st'
qsslellipticcurve_openssl.cpp
qsslkey_openssl.cpp
qsslsocket_openssl.cpp
ssl\qsslsocket_openssl.cpp(393): error C2065: 'SSL_CTRL_SET_TLSEXT_HOSTNAME': undeclared identifier
qsslsocket_openssl_symbols.cpp
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'











Resolution
1. tlsext_tick_lifetime_hint is actually a member of ssl_session_st but the section of code is inside a preprocessor directive. Goto your openssl source directory and edit ssl.h. eg.
Edit C:\openssl-win32\include\openssl\ssl.h. Comment out line 478 and 489, save and close.

478//#ifndef OPENSSL_NO_TLSEXT
479            char *tlsext_hostname;
 .               /* RFC4507 info */
 .              unsigned char *tlsext_tick;          /* Session ticket */
 .             size_t    tlsext_ticklen;                   /* Session ticket length */          
 .              long tlsext_tick_lifetime_hint;   /* Session lifetime hint in seconds */

489//#endif




ii. SSL_CTRL_SET_TLSEXT_HOSTNAME is undeclared!
Goto your Qt 5.6 source directory and edit qsslsocket_openssl.cpp. eg.
Edit C:\Qt5.6\qtbase\src\network\ssl\qsslsocket_openssl.cpp and define the variable. e.g


353 bool QSslSocketBackendPrivate::initSslContext()
354 {
355 Q_Q(QSslSocket);
356         #ifndef SSL_CTRL_SET_TLSEXT_HOSTNAME
357         #define SSL_CTRL_SET_TLSEXT_HOSTNAME 55
358         #endif
........
.......}




  




        2. Missing icu dlls; icuuc54.dll and icuin54.dll

call C:\Qt5.6\qtbase\src\widgets\uic_wrapper.bat dialogs\qfiledialog.ui -o .uic\ui_qfiledialog.h
NMAKE : fatal error U1077: 'call' : return code '0xc0000135'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

NMAKE : fatal error U1077: 'cd' : return code '0x2'



Resolution
Ensure icu is in path.

SET PATH=%PATH%;C:\icu\dist\bin; set INCLUDE=%INCLUDE%;C:\icu\dist\include; set LIB=%LIB%;C:\icu\dist\bin

3. Implicit Conversion

You can check Microsoft page for warning C4334. This warning was treated as error in file skedge.cpp and so it terminated the build process. 



[1838/11974] CXX obj\src\3rdparty\chromium\third_party\skia\src\core\skia_library.SkEdge.obj
FAILED: ninja -t msvc -e environment.x86 -- cl.exe /nologo /showIncludes /FC @obj\src\3rdparty\chromium\third_party\skia\src\core\skia_library.SkEdge.obj.rsp /c c:\qt5.6\qtwebengine\src\3rdparty\chromium\third_party\skia\src\core\SkEdge.cpp /Foobj\src\3rdparty\chromium\third_party\skia\src\core\skia_library.SkEdge.obj /Fdobj\src\3rdparty\chromium\skia\skia_library.cc.pdb
c:\qt5.6\qtwebengine\src\3rdparty\chromium\third_party\skia\src\core\skedge.cpp(231): error C2220: warning treated as error - no 'object' file generated
c:\qt5.6\qtwebengine\src\3rdparty\chromium\third_party\skia\src\core\skedge.cpp(231): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
[1838/11974] CXX obj\src\3rdparty\chromium\third_party\skia\src\core\skia_library.SkFontHost.obj
ninja: build stopped: subcommand failed.
NMAKE : fatal error U1077: 'C:\Qt5.6\qtwebengine\src\3rdparty\ninja\ninja.exe' : return code '0x1'
Stop.

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'



Resolution

Edit line 321 in C:\Qt5.6\qtwebengine\src\3rdparty\chromium\third_party\skia\src\core\SkEdge.cpp. e.g


231 fCurveCount = SkToS8(1i64 << shift);


4. sqlite3 error




qtbase\include\QtGui\5.6.0 -IC:\Qt5.6\qtbase\include\QtGui\5.6.0\QtGui -IC:\Qt5.6\qtmultimedia\include -IC:\Qt5.6\qtmultimedia\include\QtMultimedia -IC:\Qt5.6\qtbase\include -IC:\Qt5.6\qtbase\include\QtGui -IC:\Qt5.6\qtbase\include\QtNetwork -IC:\Qt5.6\qtbase\include\QtSql -IC:\Qt5.6\qtbase\include\QtCore\5.6.0 -IC:\Qt5.6\qtbase\include\QtCore\5.6.0\QtCore -IC:\Qt5.6\qtsensors\include -IC:\Qt5.6\qtsensors\include\QtSensors -IC:\Qt5.6\qtbase\include\QtCore -I.moc\debug -IC:\Qt5.6\qtbase\mkspecs\win32-msvc2015  -Fo.obj\debug\ @C:\Users\Admin\AppData\Local\Temp\nmA076.tmp
SQLiteAuthorizer.cpp
platform\sql\SQLiteAuthorizer.cpp(32): fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory
SQLiteDatabase.cpp

platform\sql\SQLiteDatabase.cpp(34): fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory






Resolution

Ensure SQLITE3SRCDIR variable is properly set and pointing to the right directory containing all sqlite3 files. Run the command below, assuming your sqllite3 files are in C:\Qt5.6\qtbase\src\3rdparty\sqlite.

SET SQLITE3SRCDIR=C:\Qt5.6\qtbase\src\3rdparty\sqlite


1 comment:

  1. Hi! thanks for the info.
    On number 2. I had also to add C:\icu\dist\lib to the PATH

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...