webview Compile

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
User avatar
archman007
Experienced Solver
Experienced Solver
Posts: 55
Joined: Mon Jan 13, 2020 1:06 pm
Location: Jacksonville, Fl 32210
Contact:

webview Compile

Post by archman007 »

The command to compile wxWebView follows
g++ -o $1 $1.cpp `wx-config --cxxflags --libs std,webview`
The parameter passed was webview.

The output is:
webview.cpp:101:55: error: ‘wxWebViewWindowFeatures’ has not been declared
101 | WebFrame(const wxString& url, bool isMain = true, wxWebViewWindowFeatures* windowFeatures = nullptr);
| ^~~~~~~~~~~~~~~~~~~~~~~
webview.cpp:276:37: error: ‘wxWebViewHandlerRequest’ does not name a type; did you mean ‘wxWebViewHandler’?
276 | virtual void StartRequest(const wxWebViewHandlerRequest& request,
| ^~~~~~~~~~~~~~~~~~~~~~~
| wxWebViewHandler
webview.cpp:277:43: error: ‘wxWebViewHandlerResponse’ was not declared in this scope; did you mean ‘wxWebViewHandler’?
277 | wxSharedPtr<wxWebViewHandlerResponse> response) override
| ^~~~~~~~~~~~~~~~~~~~~~~~
| wxWebViewHandler
webview.cpp:277:67: error: template argument 1 is invalid
277 | wxSharedPtr<wxWebViewHandlerResponse> response) override
| ^
webview.cpp:276:18: error: ‘virtual void AdvancedWebViewHandler::StartRequest(const int&, int)’ marked ‘override’, but does not override
276 | virtual void StartRequest(const wxWebViewHandlerRequest& request,
| ^~~~~~~~~~~~
webview.cpp: In member function ‘virtual void AdvancedWebViewHandler::StartRequest(const int&, int)’:
webview.cpp:279:17: error: base operand of ‘->’ is not a pointer
279 | response->SetHeader("Access-Control-Allow-Origin", "*");
| ^~
webview.cpp:280:17: error: base operand of ‘->’ is not a pointer
280 | response->SetHeader("Access-Control-Allow-Headers", "*");
| ^~
webview.cpp:283:21: error: request for member ‘GetMethod’ in ‘request’, which is of non-class type ‘const int’
283 | if (request.GetMethod().IsSameAs("options", false))
| ^~~~~~~~~
webview.cpp:285:21: error: base operand of ‘->’ is not a pointer
285 | response->Finish("");
| ^~
webview.cpp:289:17: error: base operand of ‘->’ is not a pointer
289 | response->SetContentType("application/json");
| ^~
webview.cpp:290:17: error: base operand of ‘->’ is not a pointer
290 | response->Finish(
| ^~
webview.cpp:293:25: error: request for member ‘GetHeader’ in ‘request’, which is of non-class type ‘const int’
293 | request.GetHeader("Content-Type"),
| ^~~~~~~~~
webview.cpp:294:25: error: request for member ‘GetMethod’ in ‘request’, which is of non-class type ‘const int’
294 | request.GetMethod(),
| ^~~~~~~~~
webview.cpp:295:25: error: request for member ‘GetDataString’ in ‘request’, which is of non-class type ‘const int’
295 | request.GetDataString()
| ^~~~~~~~~~~~~
webview.cpp: At global scope:
webview.cpp:338:54: error: ‘wxWebViewWindowFeatures’ has not been declared
338 | WebFrame::WebFrame(const wxString& url, bool isMain, wxWebViewWindowFeatures* windowFeatures):
| ^~~~~~~~~~~~~~~~~~~~~~~
webview.cpp: In constructor ‘WebFrame::WebFrame(const wxString&, bool, int*)’:
webview.cpp:424:52: error: request for member ‘GetChildWebView’ in ‘* windowFeatures’, which is of non-class type ‘int’
424 | m_browser = (windowFeatures) ? windowFeatures->GetChildWebView() : wxWebView::New();
| ^~~~~~~~~~~~~~~
webview.cpp:449:93: error: invalid new-expression of abstract class type ‘AdvancedWebViewHandler’
449 | m_browser->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new AdvancedWebViewHandler()));
| ^
webview.cpp:269:7: note: because the following virtual functions are pure within ‘AdvancedWebViewHandler’:
269 | class AdvancedWebViewHandler: public wxWebViewHandler
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from webview.cpp:29:
/usr/include/wx-3.2/wx/webview.h:103:23: note: ‘virtual wxFSFile* wxWebViewHandler::GetFile(const wxString&)’
103 | virtual wxFSFile* GetFile(const wxString &uri) = 0;
| ^~~~~~~
webview.cpp:464:29: error: request for member ‘GetSize’ in ‘* windowFeatures’, which is of non-class type ‘int’
464 | if (windowFeatures->GetSize().IsFullySpecified())
| ^~~~~~~
webview.cpp:465:45: error: request for member ‘GetSize’ in ‘* windowFeatures’, which is of non-class type ‘int’
465 | SetSize(FromDIP(windowFeatures->GetSize()));
| ^~~~~~~
webview.cpp:466:29: error: request for member ‘GetPosition’ in ‘* windowFeatures’, which is of non-class type ‘int’
466 | if (windowFeatures->GetPosition().IsFullySpecified())
| ^~~~~~~~~~~
webview.cpp:467:42: error: request for member ‘GetPosition’ in ‘* windowFeatures’, which is of non-class type ‘int’
467 | Move(FromDIP(windowFeatures->GetPosition()));
| ^~~~~~~~~~~
webview.cpp:468:30: error: request for member ‘ShouldDisplayToolBar’ in ‘* windowFeatures’, which is of non-class type ‘int’
468 | if (!windowFeatures->ShouldDisplayToolBar())
| ^~~~~~~~~~~~~~~~~~~~
webview.cpp:470:30: error: request for member ‘ShouldDisplayMenuBar’ in ‘* windowFeatures’, which is of non-class type ‘int’
470 | if (!windowFeatures->ShouldDisplayMenuBar())
| ^~~~~~~~~~~~~~~~~~~~
webview.cpp:606:10: error: ‘wxEVT_WEBVIEW_NEWWINDOW_FEATURES’ was not declared in this scope; did you mean ‘wxEVT_WEBVIEW_NEWWINDOW’?
606 | Bind(wxEVT_WEBVIEW_NEWWINDOW_FEATURES, &WebFrame::OnNewWindowFeatures, this, m_browser->GetId());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| wxEVT_WEBVIEW_NEWWINDOW
webview.cpp:611:10: error: ‘wxEVT_WEBVIEW_WINDOW_CLOSE_REQUESTED’ was not declared in this scope
611 | Bind(wxEVT_WEBVIEW_WINDOW_CLOSE_REQUESTED, &WebFrame::OnWindowCloseRequested, this, m_browser->GetId());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
webview.cpp: In member function ‘void WebFrame::OnEnableBrowserAcceleratorKeys(wxCommandEvent&)’:
webview.cpp:847:16: error: ‘class wxWebView’ has no member named ‘EnableBrowserAcceleratorKeys’
847 | m_browser->EnableBrowserAcceleratorKeys(evt.IsChecked());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
webview.cpp: In member function ‘void WebFrame::OnNavigationRequest(wxWebViewEvent&)’:
webview.cpp:928:36: error: ‘class wxWebViewEvent’ has no member named ‘IsTargetMainFrame’
928 | evt.GetTarget() + "')" + ((evt.IsTargetMainFrame()) ? " mainFrame" : ""));
| ^~~~~~~~~~~~~~~~~
webview.cpp: In member function ‘void WebFrame::OnNewWindowFeatures(wxWebViewEvent&)’:
webview.cpp:988:5: error: ‘wxWebViewWindowFeatures’ was not declared in this scope; did you mean ‘OnNewWindowFeatures’?
988 | wxWebViewWindowFeatures* features = evt.GetTargetWindowFeatures();
| ^~~~~~~~~~~~~~~~~~~~~~~
| OnNewWindowFeatures
webview.cpp:988:30: error: ‘features’ was not declared in this scope
988 | wxWebViewWindowFeatures* features = evt.GetTargetWindowFeatures();
| ^~~~~~~~
webview.cpp:988:45: error: ‘class wxWebViewEvent’ has no member named ‘GetTargetWindowFeatures’
988 | wxWebViewWindowFeatures* features = evt.GetTargetWindowFeatures();
| ^~~~~~~~~~~~~~~~~~~~~~~
webview.cpp: In member function ‘void WebFrame::OnToolsClicked(wxCommandEvent&)’:
webview.cpp:1108:50: error: ‘class wxWebView’ has no member named ‘AreBrowserAcceleratorKeysEnabled’
1108 | m_browser_accelerator_keys->Check(m_browser->AreBrowserAcceleratorKeysEnabled());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How do I address these exceptions?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: webview Compile

Post by ONEEYEMAN »

Hi,
What platform?
Did you check documentation of what is required?

Thank you.
Post Reply