webview sample does not build for WXUNIV=1 (Issue #27159)

63 views
Skip to first unread message

Wlodzimierz-ABX-Skiba

unread,
Oct 5, 2026, 7:59:11 AM (11 days ago) Oct 5
to wx-...@googlegroups.com, Subscribed
Wlodzimierz-ABX-Skiba created an issue (wxWidgets/wxWidgets#27159)

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

Description

I build wxWidgets and all samples with two commands:

  1. mingw32-make -f makefile.gcc
  2. mingw32-make -f makefile.gcc WXUNIV=1 MONOLITHIC=1

First command builds library and all samples fine.
Second command builds library fine and most samples except webview sample. The error is:
g++ -o gcc_mswunivud\webview.exe @gcc_mswunivud\webview.exe.rsp -g -mthreads -L.....\lib\gcc_lib -Wl,--subsystem,windows -mwindows -limm32 -lwxscintillad -lwxlexillad -lwxmswuniv33ud -lwxscintillad -lwxlexillad -lwxtiffd -lwxjpegd -lwxpngd -lwxwebpd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lgdiplus -lmsimg32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme
C:/MinGW-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .....\lib\gcc_lib/libwxmswuniv33ud.a(monolib_ScintillaWX.o): in function IMContext': c:\wxWidgets-master\build\msw/../../src/stc/ScintillaWX.cpp:1967:(.text+0x4b3b): undefined reference to ImmGetContext'
C:/MinGW-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .....\lib\gcc_lib/libwxmswuniv33ud.a(monolib_ScintillaWX.o): in function ~IMContext': c:\wxWidgets-master\build\msw/../../src/stc/ScintillaWX.cpp:1971:(.text+0x4b7a): undefined reference to ImmReleaseContext'
C:/MinGW-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .....\lib\gcc_lib/libwxmswuniv33ud.a(monolib_ScintillaWX.o): in function ScintillaWX::ImeStartComposition()': c:\wxWidgets-master\build\msw/../../src/stc/ScintillaWX.cpp:1999:(.text+0x4c4a): undefined reference to ImmSetCompositionWindow'
C:/MinGW-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:\wxWidgets-master\build\msw/../../src/stc/ScintillaWX.cpp:2021:(.text+0x4e48): undefined reference to `ImmSetCompositionFontW'
collect2.exe: error: ld returned 1 exit status

Platform and version information

  • wxWidgets version you are building: master
  • wxWidgets port you are building: wxMSW with WXUNIV=1
  • OS and its version: Windows 11
  • Compiler being used: MinGW-w64
  • Non-default compiler options, if any : WXUNIV=1

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/27159@github.com>

VZ

unread,
Oct 5, 2026, 8:35:58 AM (11 days ago) Oct 5
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#27159)

-limm32 is there, but perhaps it needs to come after the wx libraries and not before them? Can you please try applying this diff and check if it helps:

diff --git a/samples/webview/makefile.gcc b/samples/webview/makefile.gcc
index b62819ca65..88fe811e96 100644
--- a/samples/webview/makefile.gcc
+++ b/samples/webview/makefile.gcc
@@ -227,7 +227,7 @@ clean:
 $(OBJS)\webview.exe: $(WEBVIEW_OBJECTS) $(OBJS)\webview_sample_rc.o
 	$(foreach f,$(subst \,/,$(WEBVIEW_OBJECTS)),$(shell echo $f >> $(subst \,/,$@).rsp.tmp))
 	@move /y $@.rsp.tmp $@.rsp >nul
-	$(CXX) -o $@ @$@.rsp  $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME)  -Wl,--subsystem,windows -mwindows      $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS)  $(__WXLIB_WEBVIEW_p)  $(__WXLIB_STC_p) -limm32 $(__WXLIB_CORE_p)  $(__WXLIB_BASE_p)  -lwxscintilla$(WXDEBUGFLAG) $(__LIB_LEXILLA_p)  $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_WEBP_p) $(__LIB_LUNASVG_p)   -lwxzlib$(WXDEBUGFLAG) -lwxregexu$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lgdiplus -lmsimg32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme
+	$(CXX) -o $@ @$@.rsp  $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME)  -Wl,--subsystem,windows -mwindows      $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS)  $(__WXLIB_WEBVIEW_p)  $(__WXLIB_STC_p) $(__WXLIB_CORE_p)  $(__WXLIB_BASE_p)  -lwxscintilla$(WXDEBUGFLAG) $(__LIB_LEXILLA_p)  $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_WEBP_p) $(__LIB_LUNASVG_p)   -limm32 -lwxzlib$(WXDEBUGFLAG) -lwxregexu$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lgdiplus -lmsimg32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme
 	@-del $@.rsp
 
 data: 

?

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

Wlodzimierz-ABX-Skiba

unread,
Oct 5, 2026, 8:51:17 AM (11 days ago) Oct 5
to wx-...@googlegroups.com, Subscribed
Wlodzimierz-ABX-Skiba left a comment (wxWidgets/wxWidgets#27159)

Yes, @vadz , it helped. The build now finishes fine however there is a lot of run-time asserts. I will analize them for separated reports later.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

Maarten

unread,
Oct 5, 2026, 9:05:37 AM (11 days ago) Oct 5
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#27159)

For what it's worth, this is not caused by WXUNIV=1, but by MONOLITHIC=1.


Unrelated, when I tried to build the libraries using the makefile, I got these warnings:

../../src/msw/darkmode.cpp: In instantiation of 'bool {anonymous}::TryLoadByOrd(T&, const wxDynamicLibrary&, int) [with T = bool (*)()]':
../../src/msw/darkmode.cpp:250:24:   required from here
  250 |            TryLoadByOrd(gs_ShouldAppsUseDarkMode, dllUxTheme, 132) &&
      |            ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/msw/darkmode.cpp:164:12: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'bool (*)()' [-Wcast-function-type]
  164 |     func = (T)::GetProcAddress(lib.GetLibHandle(), MAKEINTRESOURCEA(ordinal));
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/msw/darkmode.cpp: In instantiation of 'bool {anonymous}::TryLoadByOrd(T&, const wxDynamicLibrary&, int) [with T = bool (*)(HWND__*, bool)]':
../../src/msw/darkmode.cpp:251:24:   required from here
  251 |            TryLoadByOrd(gs_AllowDarkModeForWindow, dllUxTheme, 133) &&
      |            ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/msw/darkmode.cpp:164:12: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'bool (*)(HWND__*, bool)' [-Wcast-function-type]
  164 |     func = (T)::GetProcAddress(lib.GetLibHandle(), MAKEINTRESOURCEA(ordinal));
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/msw/darkmode.cpp: In instantiation of 'bool {anonymous}::TryLoadByOrd(T&, const wxDynamicLibrary&, int) [with T = PreferredAppMode (*)(PreferredAppMode)]':
../../src/msw/darkmode.cpp:252:24:   required from here
  252 |            TryLoadByOrd(gs_SetPreferredAppMode, dllUxTheme, 135) &&
      |            ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/msw/darkmode.cpp:164:12: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to '{anonymous}::PreferredAppMode (*)({anonymous}::PreferredAppMode)' [-Wcast-function-type]
  164 |     func = (T)::GetProcAddress(lib.GetLibHandle(), MAKEINTRESOURCEA(ordinal));
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A possible fix is:

diff --git "a/src/msw/darkmode.cpp" "b/src/msw/darkmode.cpp"
index 2a518475e7..ec68979053 100644
--- "a/src/msw/darkmode.cpp"
+++ "b/src/msw/darkmode.cpp"
@@ -161,7 +161,7 @@ bool gs_hasChanged = false;
 template <typename T>
 bool TryLoadByOrd(T& func, const wxDynamicLibrary& lib, int ordinal)
 {
-    func = (T)::GetProcAddress(lib.GetLibHandle(), MAKEINTRESOURCEA(ordinal));
+    func = (T)(void *)::GetProcAddress(lib.GetLibHandle(), MAKEINTRESOURCEA(ordinal));
     if ( !func )
     {
         wxLogTrace(TRACE_DARKMODE,

Should I create a PR with this, or could you apply it immediately @vadz ?

I added an extra cast to (void *), similar to wxDynamicLibrary::RawGetSymbol().

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

VZ

unread,
Oct 5, 2026, 9:13:12 AM (11 days ago) Oct 5
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#27159)

@MaartenBent I'll include this in the PR I'm working on: I've realized that we've now ended up with wxIMCContext loading IMM functions dynamically in core and the older IMContext in stc which doesn't make much sense, so I'm trying to refactor this.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

VZ

unread,
Oct 5, 2026, 9:35:40 AM (11 days ago) Oct 5
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#27159)

PR created, it should fix the linking problems and the warnings.

BTW, I have no idea if wxWebView actually works with wxUniv, but this is a different story...

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

Wlodzimierz-ABX-Skiba

unread,
Oct 5, 2026, 10:45:52 AM (11 days ago) Oct 5
to wx-...@googlegroups.com, Subscribed
Wlodzimierz-ABX-Skiba left a comment (wxWidgets/wxWidgets#27159)

After first run I can tell that the webview area works fine in sample in wxUniv however there are asserts from (I suppose) sample interface. I will inspect them in next days.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

VZ

unread,
Oct 5, 2026, 10:59:43 AM (11 days ago) Oct 5
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#27159)

Does the PR above fix the build problem for you?

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

Wlodzimierz-ABX-Skiba

unread,
Oct 5, 2026, 11:45:35 AM (11 days ago) Oct 5
to wx-...@googlegroups.com, Subscribed
Wlodzimierz-ABX-Skiba left a comment (wxWidgets/wxWidgets#27159)

Will be able to answer tomorrow.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

Wlodzimierz-ABX-Skiba

unread,
Oct 6, 2026, 5:07:55 AM (10 days ago) Oct 6
to wx-...@googlegroups.com, Subscribed
Wlodzimierz-ABX-Skiba left a comment (wxWidgets/wxWidgets#27159)

Does the PR above fix the build problem for you?

Yes. Builds fine now. The warning in src/msw/darkmode.cpp is removed as well. Thanks.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

VZ

unread,
Oct 6, 2026, 10:06:43 PM (10 days ago) Oct 6
to wx-...@googlegroups.com, Subscribed

Closed #27159 as completed via 055ad25.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/27159/issue_event/32652417872@github.com>

Wlodzimierz-ABX-Skiba

unread,
Oct 12, 2026, 5:32:57 AM (4 days ago) Oct 12
to wx-...@googlegroups.com, Subscribed
Wlodzimierz-ABX-Skiba left a comment (wxWidgets/wxWidgets#27159)

@vadz this problem is also in 3.2.12

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

VZ

unread,
Oct 14, 2026, 8:14:00 AM (2 days ago) Oct 14
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#27159)

@Wlodzimierz-ABX-Skiba Please try to make a PR to 3.2 fixing this based on the changes in master if you can.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

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

Reply all
Reply to author
Forward
0 new messages