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.0k 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.
  • C Offline
    C Offline
    Cobra91151
    wrote on 26 Sept 2022, 15:56 last edited by
    #1

    Hello!

    I want to build QtWebEngine module for Visual Studio 2019 but it fails.

    Output:

    [5382/18061] CXX obj/third_party/protobuf/protobuf_full/extension_set_heavy.obj
    FAILED: obj/third_party/protobuf/protobuf_full/extension_set_heavy.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_heavy.obj.rsp /c ../../../../qtwebengine/src/3rdparty/chromium/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc /Foobj/third_party/protobuf/protobuf_full/extension_set_heavy.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(294): error C2374: 'kRepHeaderSize': redefinition; multiple initialization
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(294): note: see declaration of 'kRepHeaderSize'
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(295): note: while compiling class template static data member 'const size_t google::protobuf::RepeatedField<google::protobuf::int32>::kRepHeaderSize'
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(1045): note: while compiling class template member function 'int google::protobuf::RepeatedField<google::protobuf::int32>::size(void) const'
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\descriptor.pb.h(3844): note: see reference to function template instantiation 'int google::protobuf::RepeatedField<google::protobuf::int32>::size(void) const' being compiled
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\descriptor.pb.h(500): note: see reference to class template instantiation 'google::protobuf::RepeatedField<google::protobuf::int32>' being compiled
    [5386/18061] CXX obj/third_party/protobuf/protobuf_full/generated_message_reflection.obj
    FAILED: obj/third_party/protobuf/protobuf_full/generated_message_reflection.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/generated_message_reflection.obj.rsp /c ../../../../qtwebengine/src/3rdparty/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc /Foobj/third_party/protobuf/protobuf_full/generated_message_reflection.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(294): error C2374: 'kRepHeaderSize': redefinition; multiple initialization
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(294): note: see declaration of 'kRepHeaderSize'
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(295): note: while compiling class template static data member 'const size_t google::protobuf::RepeatedField<google::protobuf::int32>::kRepHeaderSize'
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(1045): note: while compiling class template member function 'int google::protobuf::RepeatedField<google::protobuf::int32>::size(void) const'
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\descriptor.pb.h(3844): note: see reference to function template instantiation 'int google::protobuf::RepeatedField<google::protobuf::int32>::size(void) const' being compiled
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\descriptor.pb.h(500): note: see reference to class template instantiation 'google::protobuf::RepeatedField<google::protobuf::int32>' being compiled
    [5391/18061] CXX obj/third_party/protobuf/protobuf_full/message.obj
    ninja: build stopped: subcommand failed.
    NMAKE : fatal error U1077: 'call' : return code '0x1'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x86\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: '(' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    
    C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtBuild>
    

    I think, the issue is in this file: repeated_field.h(294): error C2374: 'kRepHeaderSize': redefinition; multiple initialization

    Source code (repeated_field.h):

    int current_size_;
     int total_size_;
     struct Rep {
       Arena* arena;
       Element elements[1];
     };
     // We can not use sizeof(Rep) - sizeof(Element) due to the trailing padding on
     // the struct. We can not use sizeof(Arena*) as well because there might be
     // a "gap" after the field arena and before the field elements (e.g., when
     // Element is double and pointer is 32bit).
     static const size_t kRepHeaderSize;
     // Contains arena ptr and the elements array. We also keep the invariant that
     // if rep_ is NULL, then arena is NULL.
     Rep* rep_;
    
     friend class Arena;
     typedef void InternalArenaConstructable_;
    
     // Move the contents of |from| into |to|, possibly clobbering |from| in the
     // process.  For primitive types this is just a memcpy(), but it could be
     // specialized for non-primitive types to, say, swap each element instead.
     void MoveArray(Element* to, Element* from, int size);
    
     // Copy the elements of |from| into |to|.
     void CopyArray(Element* to, const Element* from, int size);
    
     inline void InternalSwap(RepeatedField* other);
    
     // Internal helper expected by Arena methods.
     inline Arena* GetArenaNoVirtual() const {
       return (rep_ == NULL) ? NULL : rep_->arena;
     }
    
     // Internal helper to delete all elements and deallocate the storage.
     // If Element has a trivial destructor (for example, if it's a fundamental
     // type, like int32), the loop will be removed by the optimizer.
     void InternalDeallocate(Rep* rep, int size) {
       if (rep != NULL) {
         Element* e = &rep->elements[0];
         Element* limit = &rep->elements[size];
         for (; e < limit; e++) {
           e->Element::~Element();
         }
         if (rep->arena == NULL) {
           delete[] reinterpret_cast<char*>(rep);
         }
       }
     }
    };
    
    template<typename Element>
    const size_t RepeatedField<Element>::kRepHeaderSize =
       reinterpret_cast<size_t>(&reinterpret_cast<Rep*>(16)->elements[0]) - 16;
    

    I see that variable static const size_t kRepHeaderSize; is already declared and then below on line 294, the same variable is declared the second time and initialized to: const size_t RepeatedField<Element>::kRepHeaderSize = reinterpret_cast<size_t>(&reinterpret_cast<Rep*>(16)->elements[0]) - 16;

    I see one option here, for example to delete this variable first initialization: static const size_t kRepHeaderSize; . Any ideas what is the better solution to fix this issue? Thanks.

    J 1 Reply Last reply 26 Sept 2022, 16:08
    0
    • C Cobra91151
      26 Sept 2022, 22:53

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

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 28 Sept 2022, 02:49 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
      • C Cobra91151
        26 Sept 2022, 15:56

        Hello!

        I want to build QtWebEngine module for Visual Studio 2019 but it fails.

        Output:

        [5382/18061] CXX obj/third_party/protobuf/protobuf_full/extension_set_heavy.obj
        FAILED: obj/third_party/protobuf/protobuf_full/extension_set_heavy.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_heavy.obj.rsp /c ../../../../qtwebengine/src/3rdparty/chromium/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc /Foobj/third_party/protobuf/protobuf_full/extension_set_heavy.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(294): error C2374: 'kRepHeaderSize': redefinition; multiple initialization
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(294): note: see declaration of 'kRepHeaderSize'
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(295): note: while compiling class template static data member 'const size_t google::protobuf::RepeatedField<google::protobuf::int32>::kRepHeaderSize'
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(1045): note: while compiling class template member function 'int google::protobuf::RepeatedField<google::protobuf::int32>::size(void) const'
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\descriptor.pb.h(3844): note: see reference to function template instantiation 'int google::protobuf::RepeatedField<google::protobuf::int32>::size(void) const' being compiled
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\descriptor.pb.h(500): note: see reference to class template instantiation 'google::protobuf::RepeatedField<google::protobuf::int32>' being compiled
        [5386/18061] CXX obj/third_party/protobuf/protobuf_full/generated_message_reflection.obj
        FAILED: obj/third_party/protobuf/protobuf_full/generated_message_reflection.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/generated_message_reflection.obj.rsp /c ../../../../qtwebengine/src/3rdparty/chromium/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc /Foobj/third_party/protobuf/protobuf_full/generated_message_reflection.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(294): error C2374: 'kRepHeaderSize': redefinition; multiple initialization
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(294): note: see declaration of 'kRepHeaderSize'
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(295): note: while compiling class template static data member 'const size_t google::protobuf::RepeatedField<google::protobuf::int32>::kRepHeaderSize'
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\repeated_field.h(1045): note: while compiling class template member function 'int google::protobuf::RepeatedField<google::protobuf::int32>::size(void) const'
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\descriptor.pb.h(3844): note: see reference to function template instantiation 'int google::protobuf::RepeatedField<google::protobuf::int32>::size(void) const' being compiled
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtwebengine\src\3rdparty\chromium\third_party\protobuf\src\google\protobuf\descriptor.pb.h(500): note: see reference to class template instantiation 'google::protobuf::RepeatedField<google::protobuf::int32>' being compiled
        [5391/18061] CXX obj/third_party/protobuf/protobuf_full/message.obj
        ninja: build stopped: subcommand failed.
        NMAKE : fatal error U1077: 'call' : return code '0x1'
        Stop.
        NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x86\nmake.exe"' : return code '0x2'
        Stop.
        NMAKE : fatal error U1077: '(' : return code '0x2'
        Stop.
        NMAKE : fatal error U1077: 'cd' : return code '0x2'
        Stop.
        NMAKE : fatal error U1077: 'cd' : return code '0x2'
        Stop.
        
        C:\QtBuild\qt-everywhere-opensource-src-5.9.9\qtBuild>
        

        I think, the issue is in this file: repeated_field.h(294): error C2374: 'kRepHeaderSize': redefinition; multiple initialization

        Source code (repeated_field.h):

        int current_size_;
         int total_size_;
         struct Rep {
           Arena* arena;
           Element elements[1];
         };
         // We can not use sizeof(Rep) - sizeof(Element) due to the trailing padding on
         // the struct. We can not use sizeof(Arena*) as well because there might be
         // a "gap" after the field arena and before the field elements (e.g., when
         // Element is double and pointer is 32bit).
         static const size_t kRepHeaderSize;
         // Contains arena ptr and the elements array. We also keep the invariant that
         // if rep_ is NULL, then arena is NULL.
         Rep* rep_;
        
         friend class Arena;
         typedef void InternalArenaConstructable_;
        
         // Move the contents of |from| into |to|, possibly clobbering |from| in the
         // process.  For primitive types this is just a memcpy(), but it could be
         // specialized for non-primitive types to, say, swap each element instead.
         void MoveArray(Element* to, Element* from, int size);
        
         // Copy the elements of |from| into |to|.
         void CopyArray(Element* to, const Element* from, int size);
        
         inline void InternalSwap(RepeatedField* other);
        
         // Internal helper expected by Arena methods.
         inline Arena* GetArenaNoVirtual() const {
           return (rep_ == NULL) ? NULL : rep_->arena;
         }
        
         // Internal helper to delete all elements and deallocate the storage.
         // If Element has a trivial destructor (for example, if it's a fundamental
         // type, like int32), the loop will be removed by the optimizer.
         void InternalDeallocate(Rep* rep, int size) {
           if (rep != NULL) {
             Element* e = &rep->elements[0];
             Element* limit = &rep->elements[size];
             for (; e < limit; e++) {
               e->Element::~Element();
             }
             if (rep->arena == NULL) {
               delete[] reinterpret_cast<char*>(rep);
             }
           }
         }
        };
        
        template<typename Element>
        const size_t RepeatedField<Element>::kRepHeaderSize =
           reinterpret_cast<size_t>(&reinterpret_cast<Rep*>(16)->elements[0]) - 16;
        

        I see that variable static const size_t kRepHeaderSize; is already declared and then below on line 294, the same variable is declared the second time and initialized to: const size_t RepeatedField<Element>::kRepHeaderSize = reinterpret_cast<size_t>(&reinterpret_cast<Rep*>(16)->elements[0]) - 16;

        I see one option here, for example to delete this variable first initialization: static const size_t kRepHeaderSize; . Any ideas what is the better solution to fix this issue? Thanks.

        J Online
        J Online
        JonB
        wrote on 26 Sept 2022, 16:08 last edited by
        #2

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

        C J 2 Replies Last reply 26 Sept 2022, 16:20
        0
        • J JonB
          26 Sept 2022, 16:08

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

          C Offline
          C Offline
          Cobra91151
          wrote on 26 Sept 2022, 16:20 last edited by
          #3

          @JonB

          I need only Qt 5.9.9 for my project. So, I can not use later Qt version.

          J 1 Reply Last reply 26 Sept 2022, 16:23
          0
          • C Cobra91151
            26 Sept 2022, 16:20

            @JonB

            I need only Qt 5.9.9 for my project. So, I can not use later Qt version.

            J Online
            J Online
            JonB
            wrote on 26 Sept 2022, 16:23 last edited by
            #4

            @Cobra91151 Fair enough, that's an important piece of information!

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Cobra91151
              wrote on 26 Sept 2022, 17:26 last edited by
              #5

              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*);

              1 Reply Last reply
              0
              • Christian EhrlicherC Online
                Christian EhrlicherC Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 26 Sept 2022, 17:42 last edited by
                #6

                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.

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

                C 3 Replies Last reply 26 Sept 2022, 17:54
                0
                • Christian EhrlicherC Christian Ehrlicher
                  26 Sept 2022, 17:42

                  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.

                  C Offline
                  C Offline
                  Cobra91151
                  wrote on 26 Sept 2022, 17:54 last edited by
                  #7

                  @Christian-Ehrlicher

                  Ok. I will check it. Thank you.

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher
                    26 Sept 2022, 17:42

                    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.

                    C Offline
                    C Offline
                    Cobra91151
                    wrote on 26 Sept 2022, 21:54 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
                      26 Sept 2022, 17:42

                      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.

                      C Offline
                      C Offline
                      Cobra91151
                      wrote on 26 Sept 2022, 22:53 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.

                      J 1 Reply Last reply 28 Sept 2022, 02:49
                      0
                      • Christian EhrlicherC Online
                        Christian EhrlicherC Online
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on 27 Sept 2022, 14:45 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

                        C 1 Reply Last reply 27 Sept 2022, 16:09
                        0
                        • Christian EhrlicherC Christian Ehrlicher
                          27 Sept 2022, 14:45

                          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?

                          C Offline
                          C Offline
                          Cobra91151
                          wrote on 27 Sept 2022, 16:09 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
                          • J JonB
                            26 Sept 2022, 16:08

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

                            J Online
                            J Online
                            JonB
                            wrote on 27 Sept 2022, 16:11 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 :)

                            C 1 Reply Last reply 27 Sept 2022, 17:21
                            0
                            • J JonB
                              27 Sept 2022, 16:11

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

                              C Offline
                              C Offline
                              Cobra91151
                              wrote on 27 Sept 2022, 17:21 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
                              • C Offline
                                C Offline
                                Cobra91151
                                wrote on 27 Sept 2022, 17:56 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
                                • C Offline
                                  C Offline
                                  Cobra91151
                                  wrote on 27 Sept 2022, 18:58 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
                                  • C Cobra91151
                                    26 Sept 2022, 22:53

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

                                    J Offline
                                    J Offline
                                    JKSH
                                    Moderators
                                    wrote on 28 Sept 2022, 02:49 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

                                    1/16

                                    26 Sept 2022, 15:56

                                    • Login

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