Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-137412

WebEngine MSVC build failures due to missing string headers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 6.8.3
    • WebEngine
    • None
    • Windows
    • c5407a1e4dbeb0e873d724ebd850d1f4eeb4bc9a

    Description

      WebEngine bundled in 6.8.3 fails to build Using Visual Studio 2022 (compiler 14.42) due to a missing <string> header in the thirdparty gfx library.

       

      Manifests these errors:

       

      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(27): error C2039: 'string': is not a member of 'std'
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include\optional(30): note: see declaration of 'std'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(27): error C2065: 'string': undeclared identifier
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(27): error C2923: 'std::optional': 'string' is not a valid template type argument for parameter '_Ty'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(27): note: see declaration of 'string'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(29): error C2039: 'string': is not a member of 'std'
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include\optional(30): note: see declaration of 'std'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(29): error C2143: syntax error: missing ',' before '&'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(27): error C2955: 'std::optional': use of class template requires template argument list
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include\optional(213): note: see declaration of 'std::optional'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(33): error C2039: 'string': is not a member of 'std'
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include\optional(30): note: see declaration of 'std'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(33): error C2065: 'string': undeclared identifier
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(33): error C2923: 'std::optional': 'string' is not a valid template type argument for parameter '_Ty'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(33): note: see declaration of 'string'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(35): error C2039: 'string': is not a member of 'std'
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include\optional(30): note: see declaration of 'std'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(35): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(35): error C2143: syntax error: missing ',' before '&'
      ../../../../../qt-everywhere-src-6.8.3/qtwebengine/src/3rdparty/chromium\ui/gfx/win/direct_write.h(33): error C2955: 'std::optional': use of class template requires template argument list
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include\optional(213): note: see declaration of 'std::optional'

       

      Here is a patch:

       
      — a/qtwebengine/src/3rdparty/chromium/ui/gfx/win/direct_write.h     2025-06-04 06:53:10.727511000 -0700
      +++ b/qtwebengine/src/3rdparty/chromium/ui/gfx/win/direct_write.h     2025-06-04 06:53:49.200705600 -0700
      @@ -6,6 +6,7 @@
       #define UI_GFX_WIN_DIRECT_WRITE_H_

       #include <dwrite.h>
      +#include <string>

       #include "base/strings/string_piece.h"
       #include "third_party/abseil-cpp/absl/types/optional.h"

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            miked Mike Dickey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes