wxEvtHandler* eventHandler;
//...
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED);
event.SetString(jsonChunk["message"]["content"].get<std::string>());
wxCallAfter([eventHandler, event]() { eventHandler->AddPendingEvent(event.Clone()); });


/home/.../src/Network.cpp: In lambda function:
/home/.../src/Network.cpp:185:112: error: invalid user-defined conversion from ‘wxEvent*’ to ‘const wxEvent&’ [-fpermissive]
  185 |                                 wxCallAfter([eventHandler, event]() { eventHandler->AddPendingEvent(event.Clone()); });
      |                                                                                                     ~~~~~~~~~~~^~
In file included from include/Network.h:31,
                 from /home/.../src/Network.cpp:25:
/usr/local/include/wx-3.1/wx/event.h:964:5: note: candidate is: ‘wxEvent::wxEvent(int, wxEventType)’ (near match)
  964 |     wxEvent(int winid = 0, wxEventType commandType = wxEVT_NULL );
      |     ^~~~~~~
/usr/local/include/wx-3.1/wx/event.h:964:5: note:   conversion of argument 1 would be ill-formed:
/home/.../src/Network.cpp:185:112: error: invalid conversion from ‘wxEvent*’ to ‘int’ [-fpermissive]
  185 |                                 wxCallAfter([eventHandler, event]() { eventHandler->AddPendingEvent(event.Clone()); });
      |                                                                                                     ~~~~~~~~~~~^~
      |                                                                                                                |
      |                                                                                                                wxEvent*
/home/.../src/Network.cpp:185:112: error: invalid conversion from ‘wxEvent*’ to ‘int’ [-fpermissive]
  185 |                                 wxCallAfter([eventHandler, event]() { eventHandler->AddPendingEvent(event.Clone()); });
      |                                                                                                     ~~~~~~~~~~~^~
      |                                                                                                                |
      |                                                                                                                wxEvent*
/usr/local/include/wx-3.1/wx/event.h:964:17: note:   initializing argument 1 of ‘wxEvent::wxEvent(int, wxEventType)’
  964 |     wxEvent(int winid = 0, wxEventType commandType = wxEVT_NULL );
      |             ~~~~^~~~~~~~~
/home/.../src/Network.cpp:185:100: error: cannot allocate an object of abstract type ‘wxEvent’
  185 |                                 wxCallAfter([eventHandler, event]() { eventHandler->AddPendingEvent(event.Clone()); });
      |                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/usr/local/include/wx-3.1/wx/event.h:961:24: note:   because the following virtual functions are pure within ‘wxEvent’:
  961 | class WXDLLIMPEXP_BASE wxEvent : public wxObject
      |                        ^~~~~~~
/usr/local/include/wx-3.1/wx/event.h:992:22: note:     ‘virtual wxEvent* wxEvent::Clone() const’
  992 |     virtual wxEvent *Clone() const = 0;
      |                      ^~~~~
/usr/local/include/wx-3.1/wx/event.h:3627:49: note:   initializing argument 1 of ‘virtual void wxEvtHandler::AddPendingEvent(const wxEvent&)’
 3627 |     virtual void AddPendingEvent(const wxEvent& event)
      |                                  ~~~~~~~~~~~~~~~^~~~~
/home/.../src/Network.cpp: In member function ‘std::string Network::HTTPPostStream(wxEvtHandler*, const std::string&, const std::string&, const std::string&, const std::string&, int)’:
/home/.../src/Network.cpp:185:33: error: ‘wxCallAfter’ was not declared in this scope
  185 |                                 wxCallAfter([eventHandler, event]() { eventHandler->AddPendingEvent(event.Clone()); });
      |                                 ^~~~~~~~~~~
Process terminated with status 1 (0 minute(s), 5 second(s))
5 error(s), 0 warning(s) (0 minute(s), 5 second(s))