With wx3.3.2, build error in WebView component (Issue #26291)

6 views
Skip to first unread message

Morten MacFly

unread,
2:56 PM (3 hours ago) 2:56 PM
to wx-...@googlegroups.com, Subscribed
MortenMacFly created an issue (wxWidgets/wxWidgets#26291)

Build System Used

I build wxWidgets and/or my application using:

  • CMake
  • configure
  • mingw32-make with makefile.gcc
  • MSBuild (Microsoft Visual Studio solution file)
  • nmake with makefile.vc
  • Xcode
cd /d C:\Devel\wxWidgets33_64\build64\libs && C:\Devel\CodeBlocks64\MinGW64_LLVMARM\bin\c++.exe -DUNICODE -DWXBUILDING -DWX_PRECOMP -D_UNICODE -D__WXMSW__ -D__WX__ -DwxUSE_BASE=1 -DwxUSE_GUI=1 @CMakeFiles/wxmono.dir/includes_CXX.rsp -O3 -DNDEBUG -std=gnu++20 -Wall -Wundef -Wunused-parameter -Wno-ignored-attributes -Wno-ctor-dtor-privacy -Woverloaded-virtual -Winvalid-pch -Xclang -include-pch -Xclang C:/Devel/wxWidgets33_64/build64/libs/CMakeFiles/wxmono.dir/cmake_pch.hxx.pch -Xclang -include -Xclang C:/Devel/wxWidgets33_64/build64/libs/CMakeFiles/wxmono.dir/cmake_pch.hxx -MD -MT libs/CMakeFiles/wxmono.dir/__/__/__/src/msw/webview_edge.cpp.obj -MF CMakeFiles\wxmono.dir\__\__\__\src\msw\webview_edge.cpp.obj.d -o CMakeFiles\wxmono.dir\__\__\__\src\msw\webview_edge.cpp.obj -c D:\Devel\wxWidgets33_64\src\msw\webview_edge.cpp
In file included from D:\Devel\wxWidgets33_64\src\msw\webview_edge.cpp:32:
In file included from D:/Devel/wxWidgets33_64/include/wx/msw/private/webview_edge.h:20:
C:/Devel/wxWidgets33_64/build64/libs/webview/packages/Microsoft.Web.WebView2.1.0.1722.45/build/native/include/WebView2.h:19:9: warning: unknown pragma ignored [-Wunknown-pragmas]
   19 | #pragma warning( disable: 4049 )  /* more than 64k source lines */
In file included from D:\Devel\wxWidgets33_64\src\msw\webview_edge.cpp:32:
D:/Devel/wxWidgets33_64/include/wx/msw/private/webview_edge.h:29:17: error: use of undeclared identifier 'ICoreWebView2_22'
   29 | __CRT_UUID_DECL(ICoreWebView2_22, 0x39A89B59, 0x826D, 0x4E09, 0xA6, 0x6B, 0x79, 0x76, 0xB2, 0x98, 0xE4, 0x6F);
D:/Devel/wxWidgets33_64/include/wx/msw/private/webview_edge.h:29:17: error: use of undeclared identifier 'ICoreWebView2_22'
   29 | __CRT_UUID_DECL(ICoreWebView2_22, 0x39A89B59, 0x826D, 0x4E09, 0xA6, 0x6B, 0x79, 0x76, 0xB2, 0x98, 0xE4, 0x6F);
D:/Devel/wxWidgets33_64/include/wx/msw/private/webview_edge.h:29:17: error: use of undeclared identifier 'ICoreWebView2_22'
   29 | __CRT_UUID_DECL(ICoreWebView2_22, 0x39A89B59, 0x826D, 0x4E09, 0xA6, 0x6B, 0x79, 0x76, 0xB2, 0x98, 0xE4, 0x6F);
D:/Devel/wxWidgets33_64/include/wx/msw/private/webview_edge.h:29:1: error: expected expression
   29 | __CRT_UUID_DECL(ICoreWebView2_22, 0x39A89B59, 0x826D, 0x4E09, 0xA6, 0x6B, 0x79, 0x76, 0xB2, 0x98, 0xE4, 0x6F);
C:/Devel/CodeBlocks64/MinGW64_LLVMARM/include/_mingw.h:566:58: note: expanded from macro '__CRT_UUID_DECL'
  566 |     template<> constexpr const GUID &__mingw_uuidof<type*>() {   \
D:\Devel\wxWidgets33_64\src\msw\webview_edge.cpp:1052:14: error: use of undeclared identifier 'ICoreWebView2_22'
 1052 |     wxCOMPtr<ICoreWebView2_22> webView22;
D:\Devel\wxWidgets33_64\src\msw\webview_edge.cpp:1058:13: error: use of undeclared identifier 'COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_ALL'
 1058 |             COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_ALL);
1 warning and 6 errors generated.
mingw32-make[2]: *** [libs\CMakeFiles\wxmono.dir\build.make:9414: libs/CMakeFiles/wxmono.dir/__/__/__/src/msw/webview_edge.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:828: libs/CMakeFiles/wxmono.dir/all] Error 2
mingw32-make: *** [C:/Devel/wxWidgets33_64/build64/Makefile:138: all] Error 2
mingw32-make[2]: Leaving directory 'C:/Devel/wxWidgets33_64/build64'
mingw32-make[1]: Leaving directory 'C:/Devel/wxWidgets33_64/build64'

Description

Build with version wx3.3.1 was fine, same build (with same compiler) on wx3.3.2 fails. I traced it back to the new method:
void wxWebViewEdgeImpl::AddWebResourceRequestedFilter(const wxString& filterURI)
...using "ICoreWebView2_22" that causes the error.

Platform and version information


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26291@github.com>

Maarten

unread,
3:10 PM (3 hours ago) 3:10 PM
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#26291)

Hi, you probably need to update your webview2 package. You have version 1.0.1722.45 (downloaded to
C:/Devel/wxWidgets33_64/build64/libs/webview/packages/Microsoft.Web.WebView2.1.0.1722.45). If you delete this folder and re-run CMake it will download version 1.0.3485.44 which should support these new structs.

I'll have a look at adding a CMake warning/error when an older webview2 is used.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26291/4061150715@github.com>

Maarten

unread,
3:34 PM (3 hours ago) 3:34 PM
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#26291)

This patch should update WebView2 automatically, I'll create a PR for it at some point:

diff --git "a/build/cmake/lib/webview/CMakeLists.txt" "b/build/cmake/lib/webview/CMakeLists.txt"
index ae165178b8f..5c3412ce619 100644
--- "a/build/cmake/lib/webview/CMakeLists.txt"
+++ "b/build/cmake/lib/webview/CMakeLists.txt"
@@ -63,8 +63,18 @@ elseif(WXMSW)
                 ${WEBVIEW2_DEFAULT_PACKAGE_DIR}
         )
 
+        if (WEBVIEW2_PACKAGE_DIR)
+            get_filename_component(packageName ${WEBVIEW2_PACKAGE_DIR} NAME)
+            string(SUBSTRING ${packageName} 23 -1 versionStr)
+            if(${versionStr} VERSION_LESS ${WEBVIEW2_VERSION})
+                message(STATUS "Found outdated WebView2 SDK, downloading...")
+                unset(WEBVIEW2_PACKAGE_DIR CACHE)
+            endif()
+        else()
+            message(STATUS "WebView2 SDK not found, downloading...")
+        endif()
+
         if (NOT WEBVIEW2_PACKAGE_DIR)
-            message(STATUS "WebView2 SDK not found locally, downloading...")
             set(WEBVIEW2_PACKAGE_DIR ${WEBVIEW2_DEFAULT_PACKAGE_DIR} CACHE PATH "WebView2 SDK PATH" FORCE)
             file(DOWNLOAD
                 ${WEBVIEW2_URL}


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26291/4061216298@github.com>

PB

unread,
3:47 PM (3 hours ago) 3:47 PM
to wx-...@googlegroups.com, Subscribed
PBfordev left a comment (wxWidgets/wxWidgets#26291)

Should this not be updated as well:
https://github.com/wxWidgets/wxWidgets/blob/7c3e00ccbd7bd1d24adbc6717902ad8819c85b79/include/wx/msw/private/webview_edge.h#L22-L24

Unfortunately, webview2 (seemingly by design) does not provide a compile-time version, so such checks are break-prone...

The minimal required version could be also updated in the docs
https://github.com/wxWidgets/wxWidgets/blob/7c3e00ccbd7bd1d24adbc6717902ad8819c85b79/interface/wx/webview.h#L860


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26291/4061241679@github.com>

Maarten

unread,
4:06 PM (2 hours ago) 4:06 PM
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#26291)

Yes, it would be good to update that check with the latest added type, __ICoreWebView2_22_INTERFACE_DEFINED__ in this case.
And the version numbers should be the same everywhere.

I'll leave a comment in the CMake file that whenever that version is updated, the other two should be updated as well.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26291/4061282006@github.com>

Reply all
Reply to author
Forward
0 new messages