twid
twid

Reputation: 6686

error: ‘virtual bool wxTopLevelWindowGTK::Show(bool)’ is inaccessible

I am trying to compile wxWidgets first example command-line, And getting following error

/usr/local/include/wx-3.0/wx/gtk/toplevel.h: In member function ‘virtual bool MyApp::OnInit()’:
/usr/local/include/wx-3.0/wx/gtk/toplevel.h:63:18: error: ‘virtual bool wxTopLevelWindowGTK::Show(bool)’ is inaccessible
     virtual bool Show(bool show = true);
                  ^
app1.cpp:36:19: error: within this context
   frame->Show(true);
                   ^
app1.cpp:36:19: error: ‘wxTopLevelWindowGTK’ is not an accessible base of ‘MyFrame’

I am using command line to compile program

g++ -v `wx-config --version=3.0 --cxxflags` -std=c++11 `wx-config --version=3.0 --libs` app1.cpp

and getting following error log : Error Log

Complete Code: Source Code

Upvotes: 1

Views: 496

Answers (1)

john
john

Reputation: 87957

class MyFrame : wxFrame

should be

class MyFrame : public wxFrame

By default class inheritence is private. In the error message ‘wxTopLevelWindowGTK’ is not an accessible base of ‘MyFrame’ is a pretty good description of what has gone wrong.

Upvotes: 5

Related Questions