Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue with QtWebEngine compilation using VS 2019
Forum Updated to NodeBB v4.3 + New Features

Issue with QtWebEngine compilation using VS 2019

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 4 Posters 2.1k Views 1 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.
  • Christian EhrlicherC Christian Ehrlicher

    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.

    Cobra91151C Offline
    Cobra91151C Offline
    Cobra91151
    wrote on last edited by
    #7

    @Christian-Ehrlicher

    Ok. I will check it. Thank you.

    1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      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.

      Cobra91151C Offline
      Cobra91151C Offline
      Cobra91151
      wrote on last edited by Cobra91151
      #8

      @Christian-Ehrlicher

      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.

      1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        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.

        Cobra91151C Offline
        Cobra91151C Offline
        Cobra91151
        wrote on last edited by Cobra91151
        #9

        @Christian-Ehrlicher

        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 old Qt version? It could be not the latest QtWebEngine but for example module from Qt 5.14.X? Or the QtWebEngine module is strickly related to the Qt version and it is not possible to compile it? Thank you.

        JKSHJ 1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #10

          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?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          Cobra91151C 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            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?

            Cobra91151C Offline
            Cobra91151C Offline
            Cobra91151
            wrote on last edited by Cobra91151
            #11

            @Christian-Ehrlicher

            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 between Qt 5.9.9 and Qt 5.15.6. Anyway, thank you for your help.

            1 Reply Last reply
            0
            • JonBJ JonB

              @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?

              JonBJ Online
              JonBJ Online
              JonB
              wrote on last edited by
              #12

              @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 :)

              Cobra91151C 1 Reply Last reply
              0
              • JonBJ JonB

                @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 :)

                Cobra91151C Offline
                Cobra91151C Offline
                Cobra91151
                wrote on last edited by Cobra91151
                #13

                @JonB

                I have compiled Qt 5.9.9 for VS2019 successfully. But on X64 architecture the windeployqt.exe distributes the wrong Qt libs in Debug 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.

                1 Reply Last reply
                0
                • Cobra91151C Offline
                  Cobra91151C Offline
                  Cobra91151
                  wrote on last edited by Cobra91151
                  #14

                  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.

                  1 Reply Last reply
                  0
                  • Cobra91151C Offline
                    Cobra91151C Offline
                    Cobra91151
                    wrote on last edited by
                    #15

                    I have fixed this issue by replacing the windeployqt tool from Qt 5.15.6. Now, it works for Qt 5.9.9 without issues.

                    Also, I will try to build QtWebEngine module from Qt 5.15.6 source using Qt 5.9.9 to test it.

                    1 Reply Last reply
                    0
                    • Cobra91151C Cobra91151

                      @Christian-Ehrlicher

                      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 old Qt version? It could be not the latest QtWebEngine but for example module from Qt 5.14.X? Or the QtWebEngine module is strickly related to the Qt version and it is not possible to compile it? Thank you.

                      JKSHJ Offline
                      JKSHJ Offline
                      JKSH
                      Moderators
                      wrote on last edited by JKSH
                      #16

                      @Cobra91151 said in Issue with QtWebEngine compilation using VS 2019:

                      Is it possible to build newest QtWebEngine module against old Qt version? It could be not the latest QtWebEngine but for example module from Qt 5.14.X? Or the QtWebEngine module is strickly related to the Qt 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.

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      1 Reply Last reply
                      2

                      • Login

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