Fix wxMSW build errors when wxUSE_REGKEY=0 (PR #26332)

32 views
Skip to first unread message

stahta01

unread,
Mar 31, 2026, 4:41:31 PM (3 days ago) Mar 31
to wx-...@googlegroups.com, Subscribed

Tested with
`# Testing done under MSys2 UCRT64 enviroment
cd "C:\devel\repos\wxwidgets_libs\wxWidgets"
rm -fR cmake_build_msw_shared_unicode
mkdir -p cmake_build_msw_shared_unicode
cmake
-DwxBUILD_TOOLKIT="msw"
-DBUILD_SHARED_LIBS="ON"
-DwxBUILD_SHARED="ON"
-DwxUSE_REGKEY="OFF" -DwxUSE_MIMETYPE="OFF" -DwxUSE_WEBVIEW="OFF"
-S .
-B cmake_build_msw_shared_unicode
cmake --build cmake_build_msw_shared_unicode

`


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26332

Commit Summary

  • 2cbfb3e Fix wxMSW build errors when wxUSE_REGKEY=0

File Changes

(7 files)

Patch Links:


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/pull/26332@github.com>

stahta01

unread,
Mar 31, 2026, 4:43:27 PM (3 days ago) Mar 31
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

I did not know what to do with the MIMETYPE and WEBVIEW build errors.


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/pull/26332/c4165389675@github.com>

VZ

unread,
Mar 31, 2026, 5:42:53 PM (3 days ago) Mar 31
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26332)

Looks good to me, thanks.

I did not know what to do with the MIMETYPE and WEBVIEW build errors.

MIME types can't be meaningfully supported without registry access, so I think wxUSE_MIMETYPE should be set to 0 in this case. I am not sure that is the "WEBVIEW build error"?


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/pull/26332/c4165769912@github.com>

stahta01

unread,
Mar 31, 2026, 5:47:56 PM (3 days ago) Mar 31
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

Part of the error was this; I am building again to get full error
wxWidgets/src/msw/webview_ie.cpp:66:13: error: 'wxRegKey' was not declared in this scope


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/pull/26332/c4165790674@github.com>

stahta01

unread,
Mar 31, 2026, 6:01:00 PM (3 days ago) Mar 31
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

Building with [-DwxUSE_REGKEY="OFF" -DwxUSE_MIMETYPE="OFF" -DwxUSE_WEBVIEW_IE="OFF"] built okay


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/pull/26332/c4165847979@github.com>

Lauri Nurmi

unread,
Apr 1, 2026, 7:11:19 AM (3 days ago) Apr 1
to wx-...@googlegroups.com, Subscribed
lanurmi left a comment (wxWidgets/wxWidgets#26332)

Out of curiosity, is there some real-world advantage in building with wxUSE_REGKEY disabled?


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/pull/26332/c4169309874@github.com>

VZ

unread,
Apr 1, 2026, 8:18:35 AM (3 days ago) Apr 1
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26332)

I thought you would want to add the logic for disabling the components that don't compile without it to wx/chkconf.h, do you plan to do it? If not, I can merge this as is.


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/pull/26332/c4169678363@github.com>

stahta01

unread,
Apr 1, 2026, 4:07:58 PM (2 days ago) Apr 1
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

I plan to do a single PR that does that in the future once I find all the things that need done. I have a few other related things I am testing to make wxWidgets to build and run under MSys2 /usr/bin Cygwin like environment.


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/pull/26332/c4172676030@github.com>

VZ

unread,
Apr 1, 2026, 4:43:15 PM (2 days ago) Apr 1
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26332)

FWIW I am pretty sure that wx supports MSYS2 just fine if you simply use the default build options.

I also don't understand why do you want to disable wxRegKey and while I don't want to prevent you from fixing build problems due to it, this is definitely a very low priority.


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/pull/26332/c4172851330@github.com>

stahta01

unread,
Apr 1, 2026, 5:56:20 PM (2 days ago) Apr 1
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

FWIW I am pretty sure that wx supports MSYS2 just fine if you simply use the default build options.

I also don't understand why do you want to disable wxRegKey and while I don't want to prevent you from fixing build problems due to it, this is definitely a very low priority.

The MSys2 has either MINGW environments or the CYGWIN like environment that I am trying to build for right now.
And I am finding some corner cases that I verify exists under the UCRT64 MINGW enviroment.


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/pull/26332/c4173200500@github.com>

stahta01

unread,
Apr 1, 2026, 7:10:39 PM (2 days ago) Apr 1
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

I have decided to start the work in this PR to do the checks; might be a while before I figure out how to do it. It been over 5 years since I looked at those files.


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/pull/26332/c4173493491@github.com>

stahta01

unread,
Apr 1, 2026, 8:14:20 PM (2 days ago) Apr 1
to wx-...@googlegroups.com, Push

@stahta01 pushed 1 commit.

  • 6bf83df Add aborts when wxUSE_REGKEY=0


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/2cbfb3efe62d8523cd2b31de1edfdc9ee9f9f33a/after/6bf83df996d91be4df505c5f5e55a999896b3c10@github.com>

stahta01

unread,
Apr 2, 2026, 3:03:11 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

I found #14514 issue and think I can add a fix to that to this PR. Do it in this PR or in a separate PR after this one?


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/pull/26332/c4179895188@github.com>

stahta01

unread,
Apr 2, 2026, 3:47:06 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Push

@stahta01 pushed 3 commits.

  • b01c07b Fix wxMSW build errors when wxUSE_REGKEY=0
  • 646d361 change wxUSE_CONFIG_NATIVE setting logic in
  • 726e8d7 Add aborts when wxUSE_REGKEY=0


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/6bf83df996d91be4df505c5f5e55a999896b3c10/after/726e8d715710b8325b489774f401d3ec0ea305ed@github.com>

stahta01

unread,
Apr 2, 2026, 4:33:19 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Push

@stahta01 pushed 2 commits.

  • 3d7c5b6 Add aborts when wxUSE_REGKEY=0
  • 31b51ac Fix build of sample when wxUSE_REGKEY=0


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/726e8d715710b8325b489774f401d3ec0ea305ed/after/31b51ac31df14919bced6c11c1f869e460add227@github.com>

stahta01

unread,
Apr 2, 2026, 4:38:33 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Push

@stahta01 pushed 1 commit.

  • dbe3c79 Add wxUSE_MIMETYPE guard to samples


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/31b51ac31df14919bced6c11c1f869e460add227/after/dbe3c791ebc6b29f9d644523a1a55f7d278a1872@github.com>

stahta01

unread,
Apr 2, 2026, 5:06:53 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Push

@stahta01 pushed 2 commits.

  • 01fc2c4 Fix build of sample when wxUSE_REGKEY=0
  • 16da3cc Add wxUSE_MIMETYPE guard to samples


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/dbe3c791ebc6b29f9d644523a1a55f7d278a1872/after/16da3ccedf08db6d7c27c03b748d2c317e3b10da@github.com>

VZ

unread,
Apr 2, 2026, 5:09:42 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26332)

I added the needed changes to this PR; if needed I can remove them.

This is fine, please feel free to add any other fixes for building with wxUSE_XXX=0 here too. Just don't forget to remove the draft status when this is ready.


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/pull/26332/c4180489664@github.com>

stahta01

unread,
Apr 2, 2026, 5:44:40 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Push

@stahta01 pushed 2 commits.

  • 4b4085f Build fixes when wxUSE_INTL=0
  • 709a933 Fix sample builds for wxUSE_INTL=0


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/16da3ccedf08db6d7c27c03b748d2c317e3b10da/after/709a933ec427f859693d7bb24b29b8196b8647cf@github.com>

stahta01

unread,
Apr 2, 2026, 6:39:32 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

Everything but a single task has finished marking as ready because that appears to be taking a long time to start running.


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/pull/26332/c4180848261@github.com>

VZ

unread,
Apr 2, 2026, 6:45:06 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed

@vadz approved this pull request.

Mostly looks good, thanks, but I wonder if a couple of the changes are really necessary now.


In include/wx/config.h:

> @@ -20,7 +20,7 @@
 
 // under Windows we prefer to use the native implementation but can be forced
 // to use the file-based one
-#if defined(__WINDOWS__) && wxUSE_CONFIG_NATIVE
+#if defined(__WINDOWS__) && wxUSE_CONFIG_NATIVE && wxUSE_REGKEY

Is this still needed after the changes in wx/msw/chkconf.h? AFAICS it shouldn't be.


In samples/regtest/regtest.cpp:

> @@ -25,7 +25,7 @@
 #include "wx/imaglist.h"
 #include "wx/tokenzr.h"
 
-#if wxUSE_CONFIG_NATIVE && defined( __WINDOWS__ )
+#if wxUSE_CONFIG_NATIVE && defined( __WINDOWS__ ) && wxUSE_REGKEY

Same question as for the change wx/config.h.


In samples/typetest/typetest.h:

> +    MyApp()
+    {
+        m_textCtrl = nullptr;
+#if wxUSE_MIMETYPE
+        m_mimeDatabase = nullptr;
+#endif // wxUSE_MIMETYPE
+    }

Ideal would be to replace this with

MyApp() = default;

and initialize the variables in their declarations, this would reduce the amount of #ifs.


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/pull/26332/review/4053538974@github.com>

stahta01

unread,
Apr 2, 2026, 6:55:51 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed

@stahta01 commented on this pull request.


In samples/typetest/typetest.h:

> +    MyApp()
+    {
+        m_textCtrl = nullptr;
+#if wxUSE_MIMETYPE
+        m_mimeDatabase = nullptr;
+#endif // wxUSE_MIMETYPE
+    }

I am a good C programmer but a bad C++ programmer so what you posted is not something I really understand.


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/pull/26332/review/4053570944@github.com>

stahta01

unread,
Apr 2, 2026, 7:02:43 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed

@stahta01 commented on this pull request.


In samples/regtest/regtest.cpp:

> @@ -25,7 +25,7 @@
 #include "wx/imaglist.h"
 #include "wx/tokenzr.h"
 
-#if wxUSE_CONFIG_NATIVE && defined( __WINDOWS__ )
+#if wxUSE_CONFIG_NATIVE && defined( __WINDOWS__ ) && wxUSE_REGKEY

I will test and see if it works without it


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/pull/26332/review/4053586237@github.com>

stahta01

unread,
Apr 2, 2026, 7:04:38 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed

@stahta01 commented on this pull request.


In include/wx/config.h:

> @@ -20,7 +20,7 @@
 
 // under Windows we prefer to use the native implementation but can be forced
 // to use the file-based one
-#if defined(__WINDOWS__) && wxUSE_CONFIG_NATIVE
+#if defined(__WINDOWS__) && wxUSE_CONFIG_NATIVE && wxUSE_REGKEY

I will test and see if it works without it


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/pull/26332/review/4053590369@github.com>

stahta01

unread,
Apr 2, 2026, 7:09:52 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Push

@stahta01 pushed 7 commits.

  • 69b8d2d Fix wxMSW build errors when wxUSE_REGKEY=0
  • 9377ec7 change wxUSE_CONFIG_NATIVE setting logic in
  • e16c6ce Add aborts when wxUSE_REGKEY=0
  • aabed97 Fix build of sample when wxUSE_REGKEY=0
  • b40c110 Add wxUSE_MIMETYPE guard to samples
  • 3bd3baa Build fixes when wxUSE_INTL=0
  • f3af038 Fix sample builds for wxUSE_INTL=0


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/709a933ec427f859693d7bb24b29b8196b8647cf/after/f3af0385e69f1c721041477854f42c62255669c8@github.com>

stahta01

unread,
Apr 2, 2026, 7:11:02 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed

@stahta01 commented on this pull request.


In include/wx/config.h:

> @@ -20,7 +20,7 @@
 
 // under Windows we prefer to use the native implementation but can be forced
 // to use the file-based one
-#if defined(__WINDOWS__) && wxUSE_CONFIG_NATIVE
+#if defined(__WINDOWS__) && wxUSE_CONFIG_NATIVE && wxUSE_REGKEY

It tested okay on my local PC so pushed the changes


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/pull/26332/review/4053603364@github.com>

stahta01

unread,
Apr 2, 2026, 7:12:19 PM (yesterday) Apr 2
to wx-...@googlegroups.com, Subscribed

@stahta01 commented on this pull request.


In samples/regtest/regtest.cpp:

> @@ -25,7 +25,7 @@
 #include "wx/imaglist.h"
 #include "wx/tokenzr.h"
 
-#if wxUSE_CONFIG_NATIVE && defined( __WINDOWS__ )
+#if wxUSE_CONFIG_NATIVE && defined( __WINDOWS__ ) && wxUSE_REGKEY

It tested okay on my local PC so pushed the changes, this one failed on the cross compiler once maybe it will work this time. It has always worked on my local PC.


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/pull/26332/review/4053605966@github.com>

stahta01

unread,
Apr 2, 2026, 9:14:25 PM (23 hours ago) Apr 2
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

Out of curiosity, is there some real-world advantage in building with wxUSE_REGKEY disabled?

I am building wxWidgets for the MSYS2 Cygwin like environment. At first, it shut off wxUSE_REGKEY and other things till I got most of them fixed. And I decided that wxUSE_REGKEY being off might be a good idea. I have gotten both wxGTK and wxMSW to build. But minimal only works with wxMSW because my gtk3 appears to be broken.

Tim S.


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/pull/26332/c4181270978@github.com>

stahta01

unread,
12:16 AM (20 hours ago) 12:16 AM
to wx-...@googlegroups.com, Subscribed
stahta01 left a comment (wxWidgets/wxWidgets#26332)

I have no idea what to do with "samples/typetest/typetest.h"


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/pull/26332/c4181770579@github.com>

Maarten

unread,
11:04 AM (9 hours ago) 11:04 AM
to wx-...@googlegroups.com, Subscribed

@MaartenBent commented on this pull request.


In src/propgrid/props.cpp:

> @@ -2055,7 +2055,7 @@ bool wxFileProperty::DisplayEditorDialog(wxPropertyGrid* pg, wxVariant& value)
         m_dlgTitle.empty() ? _("Choose a file") : m_dlgTitle,
         m_initialPath.empty() ? path : m_initialPath,
         file,
-        m_wildcard.empty() ? wxGetTranslation(wxALL_FILES) : m_wildcard,
+        m_wildcard.empty() ? wxString(wxGetTranslation(wxALL_FILES)) : m_wildcard,

Maybe we should let wxGetTranslation always return a wxString instead of the input type / TString.

Since the return type changed from const wxString& to wxString in #26196, this comment above the functions seems obsolete and there is no need to return TString in this and the functions below it.

https://github.com/wxWidgets/wxWidgets/blob/c456ccb28f96f536774896b312aca1aa9ebb5b0a/include/wx/translation.h#L497-L504


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/pull/26332/review/4056075686@github.com>

VZ

unread,
11:07 AM (9 hours ago) 11:07 AM
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

I've left suggestions that can be applied to do what I meant in the typetest sample.


In samples/typetest/typetest.h:

> +    MyApp()
+    {
+        m_textCtrl = nullptr;
+#if wxUSE_MIMETYPE
+        m_mimeDatabase = nullptr;
+#endif // wxUSE_MIMETYPE
+    }
⬇️ Suggested change
-    MyApp()
-    {
-        m_textCtrl = nullptr;
-#if wxUSE_MIMETYPE
-        m_mimeDatabase = nullptr;
-#endif // wxUSE_MIMETYPE
-    }
+    MyApp() = default;

In samples/typetest/typetest.h:

> @@ -35,7 +47,9 @@ class MyApp: public wxApp
 
 private:
     wxTextCtrl* m_textCtrl;
⬇️ Suggested change
-    wxTextCtrl* m_textCtrl;
+    wxTextCtrl* m_textCtrl = nullptr;

In samples/typetest/typetest.h:

> @@ -35,7 +47,9 @@ class MyApp: public wxApp
 
 private:
     wxTextCtrl* m_textCtrl;
+#if wxUSE_MIMETYPE
     wxMimeTypesManager *m_mimeDatabase;
⬇️ Suggested change
-    wxMimeTypesManager *m_mimeDatabase;
+    wxMimeTypesManager* m_mimeDatabase = nullptr;


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/pull/26332/review/4056083704@github.com>

stahta01

unread,
3:41 PM (5 hours ago) 3:41 PM
to wx-...@googlegroups.com, Push

@stahta01 pushed 1 commit.

  • 083873b Update samples/typetest/typetest.h


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/f3af0385e69f1c721041477854f42c62255669c8/after/083873bea6c4741ee0a7cbcc9e8d8b134fe5089a@github.com>

stahta01

unread,
3:41 PM (5 hours ago) 3:41 PM
to wx-...@googlegroups.com, Push

@stahta01 pushed 1 commit.

  • dd83141 Update samples/typetest/typetest.h

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/083873bea6c4741ee0a7cbcc9e8d8b134fe5089a/after/dd83141d2c62e8f6347a33cb9a1b8f19cd6982d5@github.com>

stahta01

unread,
3:42 PM (5 hours ago) 3:42 PM
to wx-...@googlegroups.com, Push

@stahta01 pushed 1 commit.

  • 29b779f Update samples/typetest/typetest.h

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26332/before/dd83141d2c62e8f6347a33cb9a1b8f19cd6982d5/after/29b779ffafd83ab2634a551f3ea61bec5e39a9f6@github.com>

Reply all
Reply to author
Forward
0 new messages