wxGTK on macOS 10.15 error: `webrequest_urlsession.h: error: unknown type name 'DECLARE_WXCOCOA_OBJC_CLASS'` (Issue #25873)

30 views
Skip to first unread message

Sergey Fedorov

unread,
Oct 9, 2025, 8:12:56 PM (7 days ago) Oct 9
to wx-...@googlegroups.com, Subscribed
barracuda156 created an issue (wxWidgets/wxWidgets#25873)

@vadz Could you say what requirements urlsession has? I disable it on powerpc (using curl instead), which apparently works fine, but I assumed it should build with clang on modern macOS. I think it did build on Sonoma (not sure, need to verify), but on Catalina with clang it fails:

:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/src/common/webrequest.cpp:36:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:17:1: error: unknown type name 'DECLARE_WXCOCOA_OBJC_CLASS'
:info:build DECLARE_WXCOCOA_OBJC_CLASS(NSURLCredential);
:info:build ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:18:1: error: unknown type name 'DECLARE_WXCOCOA_OBJC_CLASS'
:info:build DECLARE_WXCOCOA_OBJC_CLASS(NSURLSession);
:info:build ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:19:1: error: unknown type name 'DECLARE_WXCOCOA_OBJC_CLASS'
:info:build DECLARE_WXCOCOA_OBJC_CLASS(NSURLSessionTask);
:info:build ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:20:1: error: unknown type name 'DECLARE_WXCOCOA_OBJC_CLASS'
:info:build DECLARE_WXCOCOA_OBJC_CLASS(wxWebSessionDelegate);
:info:build ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:40:5: error: unknown type name 'WX_NSURLCredential'
:info:build     WX_NSURLCredential GetURLCredential() const { return m_cred; }
:info:build     ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:44:5: error: unknown type name 'WX_NSURLCredential'
:info:build     WX_NSURLCredential m_cred = NULL;
:info:build     ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:44:31: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
:info:build     WX_NSURLCredential m_cred = NULL;
:info:build                               ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:52:62: error: unknown type name 'WX_NSURLSessionTask'
:info:build     wxWebResponseURLSession(wxWebRequestURLSession& request, WX_NSURLSessionTask task);
:info:build                                                              ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:68:21: error: unknown type name 'WX_NSData'
:info:build     void HandleData(WX_NSData data);
:info:build                     ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:71:5: error: unknown type name 'WX_NSURLSessionTask'
:info:build     WX_NSURLSessionTask m_task;
:info:build     ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:125:5: error: unknown type name 'WX_NSURLSessionTask'
:info:build     WX_NSURLSessionTask m_task;
:info:build     ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:152:5: error: unknown type name 'WX_NSURLSession'
:info:build     WX_NSURLSession GetSession() { return m_session; }
:info:build     ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:154:5: error: unknown type name 'WX_wxWebSessionDelegate'
:info:build     WX_wxWebSessionDelegate GetDelegate() { return m_delegate; }
:info:build     ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:157:5: error: unknown type name 'WX_NSURLSession'
:info:build     WX_NSURLSession m_session;
:info:build     ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:158:5: error: unknown type name 'WX_wxWebSessionDelegate'
:info:build     WX_wxWebSessionDelegate m_delegate;
:info:build     ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:167:14: error: cannot initialize return object of type 'wxWebSessionImpl *' with an rvalue of type 'wxWebSessionURLSession *'
:info:build     { return new wxWebSessionURLSession(); }
:info:build              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/src/common/webrequest.cpp:15:
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/webrequest.h:39:
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/event.h:16:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/object.h:284:11: error: cannot initialize a member subobject of type 'wxWebResponseImpl *' with an rvalue of type 'wxWebResponseURLSession *'
:info:build         : m_ptr(tocopy.get())
:info:build           ^     ~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:90:18: note: in instantiation of function template specialization 'wxObjectDataPtr<wxWebResponseImpl>::wxObjectDataPtr<wxWebResponseURLSession>' requested here
:info:build         { return m_response; }
:info:build                  ^
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/src/common/webrequest.cpp:15:
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/webrequest.h:39:
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/event.h:16:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/object.h:284:11: error: cannot initialize a member subobject of type 'wxWebAuthChallengeImpl *' with an rvalue of type 'wxWebAuthChallengeURLSession *'
:info:build         : m_ptr(tocopy.get())
:info:build           ^     ~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_macos-powerpc.org_macos-powerpc_PPCPorts_ports_graphics_wxgtk-3.2/wxgtk-3.2/work/wxWidgets-3.2.8.1/include/wx/osx/private/webrequest_urlsession.h:93:18: note: in instantiation of function template specialization 'wxObjectDataPtr<wxWebAuthChallengeImpl>::wxObjectDataPtr<wxWebAuthChallengeURLSession>' requested here
:info:build         { return m_authChallenge; }
:info:build                  ^
:info:build 1 warning and 17 errors generated.
:info:build make[2]: *** [libs/net/CMakeFiles/wxnet.dir/__/__/__/__/src/common/webrequest.cpp.o] Error 1

Should/can we fix it? (This is probably not a critical issue, so if this is problematic, I will just disable urlsession in wxgtk port for all macOS.)


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

VZ

unread,
Oct 10, 2025, 4:13:52 AM (7 days ago) Oct 10
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25873)

This is not about requirements at all, it's just DECLARE_WXCOCOA_OBJC_CLASS() seems to be somehow not defined in wxGTK build. I don't quite understand how it happens because its definition is guarded by

#ifdef __DARWIN__
...
#if (defined(__GNUC__) && defined(__APPLE__))

and all of those should be true in this case. Please check what's going on there and please don't disable wxWebRequest, it's a very useful class and there is no reason for it not to work in wxGTK build.

Also, we really, really need to have a CI job testing this build (wxGTK under macOS) if we seriously want to support 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/issues/25873/3388780466@github.com>

Sergey Fedorov

unread,
Oct 10, 2025, 3:12:30 PM (7 days ago) Oct 10
to wx-...@googlegroups.com, Subscribed
barracuda156 left a comment (wxWidgets/wxWidgets#25873)

@vadz Ok, thank you, I will look into this.


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/25873/3391938733@github.com>

Sergey Fedorov

unread,
Oct 10, 2025, 8:06:59 PM (6 days ago) Oct 10
to wx-...@googlegroups.com, Subscribed
barracuda156 left a comment (wxWidgets/wxWidgets#25873)

Please check what's going on there and please don't disable wxWebRequest, it's a very useful class and there is no reason for it not to work in wxGTK build.

Just to be clear, I do not disable wxWebRequest, I configure with -DwxUSE_WEBREQUEST_URLSESSION=OFF -DwxUSE_WEBREQUEST_CURL_DEFAULT=ON, because there is no NSURLSession on < 10.9.
https://developer.apple.com/documentation/foundation/urlsession

On Catalina it should build with -DwxUSE_WEBREQUEST_URLSESSION=ON though.


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/25873/3392626146@github.com>

VZ

unread,
Oct 11, 2025, 4:50:00 PM (5 days ago) Oct 11
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25873)

As you wrote this

I will just disable urlsession in wxgtk port for all macOS.

I thought you wanted to disable it even for the systems where it is supported.

Anyhow, as we officially support only 10.10+, it really should compile (and work) there.


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/25873/3393649971@github.com>

Reply all
Reply to author
Forward
0 new messages