Issue with QtWebEngine compilation using VS 2019
-
I need only
Qt 5.9.9
for my project. So, I can not use laterQt
version.@Cobra91151 Fair enough, that's an important piece of information!
-
I have commented the first initialization:
//static const size_t kRepHeaderSize;
But it leads to this error:
C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(294): error C2039: 'kRepHeaderSize': is not a member of 'google::protobuf::RepeatedField<Element>
;So, my solution is wrong. Also, I checked and found the third variable declaration and initialization on line: 526;
static const size_t kRepHeaderSize = sizeof(Rep) - sizeof(void*);
-
I would say it's an to old version of protobuf to be compilable with VS2019. But take a look here: https://github.com/protocolbuffers/protobuf/commit/a1fca10ddc2c758cafaa6891d4ef971b8a0d06b0
constexpr to the rescue!
But I would guess there will be more problems later on. -
I would say it's an to old version of protobuf to be compilable with VS2019. But take a look here: https://github.com/protocolbuffers/protobuf/commit/a1fca10ddc2c758cafaa6891d4ef971b8a0d06b0
constexpr to the rescue!
But I would guess there will be more problems later on.Ok. I will check it. Thank you.
-
I would say it's an to old version of protobuf to be compilable with VS2019. But take a look here: https://github.com/protocolbuffers/protobuf/commit/a1fca10ddc2c758cafaa6891d4ef971b8a0d06b0
constexpr to the rescue!
But I would guess there will be more problems later on.I have set
constexpr
to:static constexpr size_t kRepHeaderSize; template<typename Element> constexpr size_t RepeatedField<Element>::kRepHeaderSize = reinterpret_cast<size_t>(&reinterpret_cast<Rep*>(16)->elements[0]) - 16; static constexpr size_t kRepHeaderSize = sizeof(Rep) - sizeof(void*);
Now, I get this issue:
repeated_field.h(253): error C2737: 'private: static unsigned int const google::protobuf::RepeatedField<int>::kRepHeaderSize': constexpr object must be initialized
[5357/18061] CXX obj/third_party/protobuf/protobuf_full/extension_set.obj FAILED: obj/third_party/protobuf/protobuf_full/extension_set.obj ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x86/cl.exe" /nologo /showIncludes /FC @obj/third_party/protobuf/protobuf_full/extension_set.obj.rsp /c ../../../../qtwebengine/src/3rdparty/chromium/third_party/protobuf/src/google/protobuf/extension_set.cc /Foobj/third_party/protobuf/protobuf_full/extension_set.obj /Fd"obj/third_party/protobuf/protobuf_full_cc.pdb" C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(253): error C2737: 'private: static unsigned int const google::protobuf::RepeatedField<int>::kRepHeaderSize': constexpr object must be initialized
On 253 line, there is not initialized variable:
static constexpr size_t kRepHeaderSize;
I think, I must initialize it to some value.
I have set this variable to value:static constexpr size_t kRepHeaderSize = sizeof(Arena*) < sizeof(Element) ? sizeof(Element) : sizeof(Arena*);
I will try again to see the result. -
I would say it's an to old version of protobuf to be compilable with VS2019. But take a look here: https://github.com/protocolbuffers/protobuf/commit/a1fca10ddc2c758cafaa6891d4ef971b8a0d06b0
constexpr to the rescue!
But I would guess there will be more problems later on.Yes, you are right. It leads to another errors, then I fix them and again to another errors and so on. I do not have time to play around with it.
Is it possible to build newest
QtWebEngine
module against oldQt
version? It could be not the latestQtWebEngine
but for example module fromQt 5.14.X
? Or theQtWebEngine
module is strickly related to theQt
version and it is not possible to compile it? Thank you. -
Sorry, I'm not sure about the policy of the QWebEngine module wrt. to source backwards compatibility. You have to try it out by yourself.
Maybe you can simply update the whole protobuf lib? -
Sorry, I'm not sure about the policy of the QWebEngine module wrt. to source backwards compatibility. You have to try it out by yourself.
Maybe you can simply update the whole protobuf lib?Hello!
Ok. I think, I will try to use
Qt 5.15.6
, but from what I have checked, I need to adapt the project code, since there are some issues betweenQt 5.9.9
andQt 5.15.6
. Anyway, thank you for your help. -
@Cobra91151 said in Issue with QtWebEngine compilation using VS 2019:
qt-everywhere-opensource-src-5.9.9
Hi, you probably know better than I, but would it be better to try a later version than 5.9 for VS 2019?
@JonB said in Issue with QtWebEngine compilation using VS 2019:
Hi, you probably know better than I, but would it be better to try a later version than 5.9 for VS 2019?
@Cobra91151 said in Issue with QtWebEngine compilation using VS 2019:
I need only Qt 5.9.9 for my project. So, I can not use later Qt version.
:D Friendly grin :)
-
@JonB said in Issue with QtWebEngine compilation using VS 2019:
Hi, you probably know better than I, but would it be better to try a later version than 5.9 for VS 2019?
@Cobra91151 said in Issue with QtWebEngine compilation using VS 2019:
I need only Qt 5.9.9 for my project. So, I can not use later Qt version.
:D Friendly grin :)
I have compiled
Qt 5.9.9
forVS2019
successfully. But onX64
architecture thewindeployqt.exe
distributes the wrong Qt libs inDebug
mode.
When I try to set to use only debug libs:QMAKE_POST_LINK = $$(QTDIR)/bin/windeployqt.exe $$shell_quote($$DESTDIR/$$shell_quote($$TARGET).exe) --debug --no-compiler-runtime
it displays the following error:C:\Qt\5.9.9\msvc2019_64\bin\Qt5Coredd.dll does not exist.
Otherwise it distributes the release libs and produce such error:
This application failed to start because it could not find or load the Qt platform plugin "windows" in "". Reinstalling the application may fix this problem.
The lib in Debug mode should be Qt5Cored.dll not Qt5Coredd.dll. Any ideas how to fix this issue with
windeployqt
tool? Thanks. -
It happens only with new projects -
x64
-Debug
mode:C:\Users\cobra\Documents\Projects\CPP\build-TestEmptyProject-Desktop_Qt_5_9_9_MSVC2019_64bit-Debug\debug\TestEmptyProject.exe 64 bit, debug executable Adding Qt5Svg for qsvgicond.dll Skipping plugin qtvirtualkeyboardplugind.dll due to disabled dependencies (Qt5Qml Qt5Quick). Direct dependencies: Qt5Core Qt5Widgets All dependencies : Qt5Core Qt5Gui Qt5Widgets To be deployed : Qt5Core Qt5Gui Qt5Svg Qt5Widgets C:\Qt\5.9.9\msvc2019_64\bin\Qt5Coredd.dll does not exist. jom: C:\Users\cobra\Documents\Projects\CPP\build-TestEmptyProject-Desktop_Qt_5_9_9_MSVC2019_64bit-Debug\Makefile.Debug [debug\TestEmptyProject.exe] Error 1 jom: C:\Users\cobra\Documents\Projects\CPP\build-TestEmptyProject-Desktop_Qt_5_9_9_MSVC2019_64bit-Debug\Makefile [debug] Error 2 20:52:22: The process "C:\Qt\qtcreator-8.0.1\bin\jom\jom.exe" exited with code 2. Error while building/deploying project TestEmptyProject (kit: Desktop Qt 5.9.9 MSVC2019 64bit) When executing step "Make" 20:52:23: Elapsed time: 00:02.
I have tried
Qt 5.9.9 x64
libs compiled on 4/14/2020. The same issue exists.For
x32
in Debug it works well:20:55:25: Running steps for project TestEmptyProject... 20:55:25: Configuration unchanged, skipping qmake step. 20:55:25: Starting: "C:\Qt\qtcreator-8.0.1\bin\jom\jom.exe" C:\Qt\qtcreator-8.0.1\bin\jom\jom.exe -f Makefile.Debug C:\Qt\5.9.9\msvc2019\bin\uic.exe ..\TestEmptyProject\dialog.ui -o ui_dialog.h cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fdresources\objects\TestEmptyProject.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\TestEmptyProject -I. -IC:\Qt\5.9.9\msvc2019\include -IC:\Qt\5.9.9\msvc2019\include\QtWidgets -IC:\Qt\5.9.9\msvc2019\include\QtGui -IC:\Qt\5.9.9\msvc2019\include\QtANGLE -IC:\Qt\5.9.9\msvc2019\include\QtCore -Iresources\moc -I. -IC:\Qt\5.9.9\msvc2019\mkspecs\win32-msvc -Foresources\objects\ @C:\Users\cobra\AppData\Local\Temp\main.obj.2756.16.jom cl -BxC:\Qt\5.9.9\msvc2019\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E C:\Qt\5.9.9\msvc2019\mkspecs\features\data\dummy.cpp 2>NUL >resources\moc\moc_predefs.h main.cpp cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fdresources\objects\TestEmptyProject.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\TestEmptyProject -I. -IC:\Qt\5.9.9\msvc2019\include -IC:\Qt\5.9.9\msvc2019\include\QtWidgets -IC:\Qt\5.9.9\msvc2019\include\QtGui -IC:\Qt\5.9.9\msvc2019\include\QtANGLE -IC:\Qt\5.9.9\msvc2019\include\QtCore -Iresources\moc -I. -IC:\Qt\5.9.9\msvc2019\mkspecs\win32-msvc -Foresources\objects\ @C:\Users\cobra\AppData\Local\Temp\dialog.obj.2756.63.jom dialog.cpp C:\Qt\5.9.9\msvc2019\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --compiler-flavor=msvc --include ./resources/moc/moc_predefs.h -IC:/Qt/5.9.9/msvc2019/mkspecs/win32-msvc -IC:/Users/cobra/Documents/Projects/CPP/TestEmptyProject -IC:/Qt/5.9.9/msvc2019/include -IC:/Qt/5.9.9/msvc2019/include/QtWidgets -IC:/Qt/5.9.9/msvc2019/include/QtGui -IC:/Qt/5.9.9/msvc2019/include/QtANGLE -IC:/Qt/5.9.9/msvc2019/include/QtCore -I. -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\ATLMFC\include" -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" ..\TestEmptyProject\dialog.h -o resources\moc\moc_dialog.cpp cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fdresources\objects\TestEmptyProject.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\TestEmptyProject -I. -IC:\Qt\5.9.9\msvc2019\include -IC:\Qt\5.9.9\msvc2019\include\QtWidgets -IC:\Qt\5.9.9\msvc2019\include\QtGui -IC:\Qt\5.9.9\msvc2019\include\QtANGLE -IC:\Qt\5.9.9\msvc2019\include\QtCore -Iresources\moc -I. -IC:\Qt\5.9.9\msvc2019\mkspecs\win32-msvc -Foresources\objects\ @C:\Users\cobra\AppData\Local\Temp\moc_dialog.obj.2756.704.jom moc_dialog.cpp link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\TestEmptyProject.exe @C:\Users\cobra\AppData\Local\Temp\TestEmptyProject.exe.2756.1813.jom C:\Qt\5.9.9\msvc2019/bin/windeployqt.exe C:/Users/cobra/Documents/Projects/CPP/build-TestEmptyProject-Desktop_Qt_5_9_9_MSVC2019_32bit-Debug/debug/TestEmptyProject.exe --debug --no-compiler-runtime C:\Users\cobra\Documents\Projects\CPP\build-TestEmptyProject-Desktop_Qt_5_9_9_MSVC2019_32bit-Debug\debug\TestEmptyProject.exe 32 bit, debug executable Adding Qt5Svg for qsvgicond.dll Skipping plugin qtvirtualkeyboardplugind.dll due to disabled dependencies (Qt5Qml Qt5Quick). Direct dependencies: Qt5Core Qt5Widgets All dependencies : Qt5Core Qt5Gui Qt5Widgets To be deployed : Qt5Core Qt5Gui Qt5Svg Qt5Widgets Qt5Cored.dll is up to date. Qt5Guid.dll is up to date. Qt5Svgd.dll is up to date. Qt5Widgetsd.dll is up to date. libGLESV2d.dll is up to date. libEGLd.dll is up to date. d3dcompiler_47.dll is up to date. Patching Qt5Cored.dll... qsvgicond.dll is up to date. qgifd.dll is up to date. qicnsd.dll is up to date. qicod.dll is up to date. qjpegd.dll is up to date. qsvgd.dll is up to date. qtgad.dll is up to date. qtiffd.dll is up to date. qwbmpd.dll is up to date. qwebpd.dll is up to date. qwindowsd.dll is up to date. Creating qt_ar.qm... Creating qt_bg.qm... Creating qt_ca.qm... Creating qt_cs.qm... Creating qt_da.qm... Creating qt_de.qm... Creating qt_en.qm... Creating qt_es.qm... Creating qt_fi.qm... Creating qt_fr.qm... Creating qt_gd.qm... Creating qt_he.qm... Creating qt_hu.qm... Creating qt_it.qm... Creating qt_ja.qm... Creating qt_ko.qm... Creating qt_lv.qm... Creating qt_pl.qm... Creating qt_ru.qm... Creating qt_sk.qm... Creating qt_uk.qm... 20:55:28: The process "C:\Qt\qtcreator-8.0.1\bin\jom\jom.exe" exited normally. 20:55:28: Elapsed time: 00:03.
I think, it is a bug with
windeployqt
tool. Can someone confirm it? Thanks. -
I have fixed this issue by replacing the
windeployqt
tool fromQt 5.15.6
. Now, it works forQt 5.9.9
without issues.Also, I will try to build
QtWebEngine
module fromQt 5.15.6
source usingQt 5.9.9
to test it. -
Yes, you are right. It leads to another errors, then I fix them and again to another errors and so on. I do not have time to play around with it.
Is it possible to build newest
QtWebEngine
module against oldQt
version? It could be not the latestQtWebEngine
but for example module fromQt 5.14.X
? Or theQtWebEngine
module is strickly related to theQt
version and it is not possible to compile it? Thank you.@Cobra91151 said in Issue with QtWebEngine compilation using VS 2019:
Is it possible to build newest
QtWebEngine
module against oldQt
version? It could be not the latestQtWebEngine
but for example module fromQt 5.14.X
? Or theQtWebEngine
module is strickly related to theQt
version and it is not possible to compile it? Thank you.The official policy is that newer versions of Qt WebEngine officially supports down to the last LTS version of Qt:
- https://doc.qt.io/qt-5/qtwebengine-platform-notes.html#using-earlier-qt-versions-to-build-qt-webengine
- https://doc.qt.io/archives/qt-5.12/qtwebengine-platform-notes.html#using-earlier-qt-versions-to-build-qt-webengine
So Qt WebEngine 5.15 can be built with Qt 5.12, and Qt WebEngine 5.12 can be built with Qt 5.9.
Just be aware that old versions put you at risk of security vulnerabilities.