I build wxWidgets and/or my application using:
I build wxWidgets and all samples with two commands:
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
—
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.![]()
-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.![]()
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.![]()
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.![]()
@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.![]()
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.![]()
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.![]()
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.![]()
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.![]()
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.![]()
—
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.![]()
@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.![]()
@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.![]()