Description
Hi, I'm trying to compile the qt webengine on windows with MSVS 2022 17.4.0 and it's failing.
The setup procedure is the same as QTBUG-108804, but is actually blocked by this, meaning that I had to resolve this bug first before being able to reproduce QTBUG-108804.
This is the error that I get
ninja -t msvc -e environment.x64 -- "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64/cl.exe" /c ../../../../../../../9020f6/1/qt6/qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkKeyHelpers.cpp /Foobj/skia/skia_core_and_effects/SkKeyHelpers.obj /nologo /showIncludes -DUSE_AURA=1 -DTOOLKIT_QT -D_HAS_EXCEPTIONS=0 -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2 -DWIN32 -D_SECURE_ATL -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=NTDDI_WIN10_FE -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_ENABLE_SKSL -DSK_UNTIL_CRBUG_1187654_IS_FIXED "-DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\"" -DSK_WIN_FONTMGR_NO_SIMULATIONS -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_HAS_WUFFS_LIBRARY -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 "-DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\"" -DGR_GL_FUNCTION_TYPE=__stdcall -DVK_USE_PLATFORM_WIN32_KHR "-DSK_FREETYPE_MINIMUM_RUNTIME_VERSION=(((FREETYPE_MAJOR) * 0x01000000) | ((FREETYPE_MINOR) * 0x00010000) | ((FREETYPE_PATCH) * 0x00000100))" -DSKIA_IMPLEMENTATION=1 -DSK_GAMMA_SRGB -DSK_GAMMA_CONTRAST=0.5 -DSK_DEFAULT_FONT_CACHE_LIMIT=20971520 -DSK_DEFAULT_FONT_CACHE_COUNT_LIMIT=256 -D_CRT_NONSTDC_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -Igen -I../../../../../../../9020f6/1/qt6/qtwebengine/src/3rdparty/chromium -I../../../../../../../9020f6/1/qt6/qtwebengine/src/3rdparty/chromium/third_party/skia -I../../../../../../../9020f6/1/qt6/qtwebengine/src/3rdparty/chromium/third_party/wuffs/src/release/c -I../../../../../../../9020f6/1/qt6/qtwebengine/src/3rdparty/chromium/third_party/vulkan/include -I../../../../../../../9020f6/1/qt6/qtwebengine/src/3rdparty/chromium/third_party/vulkan-deps/vulkan-headers/src/include /Gy /FS /bigobj /utf-8 /Zc:sizedDealloc- /wd4117 /D__DATE__= /D__TIME__= /D__TIMESTAMP__= /Od /Ob0 /GF /Zi /MDd /wd4800 /wd4267 /wd4091 /wd4127 /wd4251 /wd4275 /wd4312 /wd4324 /wd4351 /wd4355 /wd4503 /wd4589 /wd4611 /wd4100 /wd4121 /wd4244 /wd4505 /wd4510 /wd4512 /wd4610 /wd4838 /wd4995 /wd4996 /wd4456 /wd4457 /wd4458 /wd4459 /wd4200 /wd4201 /wd4204 /wd4221 /wd4245 /wd4267 /wd4305 /wd4389 /wd4702 /wd4701 /wd4703 /wd4661 /wd4706 /wd4715 /wd4003 /wd4068 /wd5051 /wd4244 /std:c++17 /wd5041 /std:c++17 /Zc:alignedNew- /TP /GR- /wd4577 /Fd"obj/skia/skia_core_and_effects_cc.pdb" C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(34): error C2039: 'string': is not a member of 'std' C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\unordered_map(24): note: see declaration of 'std' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(34): error C2061: syntax error: identifier 'string' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(34): error C2039: 'string': is not a member of 'std' C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\unordered_map(24): note: see declaration of 'std' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(36): error C2187: syntax error: 'const' was unexpected here C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(37): error C2187: syntax error: 'const' was unexpected here C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(37): error C2039: 'string': is not a member of 'std' C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\unordered_map(24): note: see declaration of 'std' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(38): error C2187: syntax error: 'const' was unexpected here C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(38): error C2039: 'string': is not a member of 'std' C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\unordered_map(24): note: see declaration of 'std' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(38): error C2065: 'string': undeclared identifier C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(38): error C2923: 'std::vector': 'string' is not a valid template type argument for parameter '_Ty' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(38): note: see declaration of 'string' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(38): error C2976: 'std::vector': too few template arguments C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\vector(494): note: see declaration of 'std::vector' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(47): error C2061: syntax error: identifier 'GenerateGlueCodeForEntry' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(59): error C2039: 'string': is not a member of 'std' C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\unordered_map(24): note: see declaration of 'std' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(59): error C3646: 'getMangledUniformName': unknown override specifier C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(59): error C2059: syntax error: '(' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(59): error C2238: unexpected token(s) preceding ';' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(65): error C3646: 'fGlueCodeGenerator': unknown override specifier C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(65): error C2059: syntax error: '=' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(65): error C2238: unexpected token(s) preceding ';' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(54): error C2065: 'glueCodeGenerator': undeclared identifier C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(55): error C2065: 'numChildren': undeclared identifier C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(56): error C2065: 'dataPayloadExpectations': undeclared identifier C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(54): error C2614: 'SkShaderSnippet': illegal member initialization: 'fGlueCodeGenerator' is not a base or member C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(89): error C2039: 'string': is not a member of 'std' C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\unordered_map(24): note: see declaration of 'std' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(89): error C3646: 'emitGlueCodeForEntry': unknown override specifier C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(89): error C2059: syntax error: '(' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(90): error C2039: 'string': is not a member of 'std' C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\unordered_map(24): note: see declaration of 'std' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(91): error C2039: 'string': is not a member of 'std' C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\unordered_map(24): note: see declaration of 'std' C:\.conan\9020f6\1\qt6\qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h(92): error C2238: unexpected token(s) preceding ';'
and the fix is really as simple as adding
#include <string>
to
qtwebengine\src\3rdparty\chromium\third_party\skia\src/core/SkShaderCodeDictionary.h
To reproduce, I use conan to build it.
Here's the command that I used:
conan install conanfile.py --build missing -s build_type=Debug --settings compiler.version=17 -s "compiler=Visual Studio"
and here's the `conanfile.py`:
# import pydevd_pycharm from conans import ConanFile from conans.errors import ConanException required_conan_version = ">=1.54.0" class DragonflyConan(ConanFile): generators = "cmake", "cmake_paths", "cmake_find_package" settings = "os", "build_type" def requirements(self): # pydevd_pycharm.settrace('localhost', port=62421, stdoutToServer=True, stderrToServer=True) self.requires("qt/6.3.1") self.requires("icu/70.1") # force the use of icu 70.1 for the python distro self._add_requirements_to_manage_conflicts() def _add_requirements_to_manage_conflicts(self): # qt / opencascade self.requires('freetype/2.12.1') # qt / cpr self.requires("zlib/1.2.13") # qt / cpr self.requires("zstd/1.5.2") # qt / cpr if self._is_windows: self.requires("openssl/1.1.1s") else: self.requires("openssl/1.1.1q") @property def _is_windows(self) -> bool: return self.settings.get_safe("os") == 'Windows' @property def _is_linux(self) -> bool: return self.settings.get_safe("os") == 'Linux' @property def _is_debug_build(self) -> bool: return self.settings.get_safe("build_type") == "Debug" def configure(self): self.options["qt"].shared = True self.options["qt"].qttools = not self._is_debug_build self.options["qt"].qtwebchannel = True self.options["qt"].qtwebengine = True self.options["qt"].qtwebsockets = True self.options["qt"].qt5compat= True self.options["qt"].qtsvg= True self.options["qt"].qtimageformats= True self.options["qt"].qtscxml= True self.options["qt"].qtmultimedia= False self.options["qt"].qtactiveqt= False self.options["qt"].qtdatavis3d= False self.options["qt"].qtdeclarative= False self.options["qt"].qtlanguageserver= False self.options["qt"].qtshadertools= True # needed for the web engine and for certain aspects of font rendering self.options["qt"].qtcoap= False self.options["qt"].qtcharts= False self.options["qt"].qtconnectivity= False self.options["qt"].qtvirtualkeyboard= False self.options["qt"].qtwayland= self._is_linux self.options["qt"].qtserialbus= False self.options["qt"].qtsensors= False self.options["qt"].with_sqlite3 = False self.options["qt"].with_mysql = False self.options["qt"].with_pq = False self.options["qt"].with_odbc = False self.options["qt"].with_libjpeg = "libjpeg" self.options["qt"].with_libpng = True self.options["qt"].with_zstd = True self.options["qt"].with_md4c= True self.options["qt"].with_freetype = True self.options["qt"].with_glib = False if not self._is_windows: self.options["qt"].with_icu = True self.options["qt"].gui = True self.options["qt"].widgets = True self.options["harfbuzz"].with_glib = False # disable glib to prevent gpl dependencies #self.options["harfbuzz"].shared = False #self.options["harfbuzz"].with_icu = True self.options["cpr"].shared = True self.options["freetype"].shared = False self.options["glew"].shared = True self.options["zstd"].shared = True self.options["zlib"].shared = True self.options["openssl"].shared = True self.options["openssl"].no_tests=True self.options["icu"].shared = True #self.options["tk"].shared = True self.options["tcl"].shared = True self.options["opencascade"].shared = True self.options["opencascade"].with_tk = False self.options["opencascade"].with_opengl = False if not self._is_windows: self.options["icu"].data_packaging = "library"