2013-10-07 14 views
0

我試圖編譯wxWidgets的第一個例子中的命令行,並獲得以下錯誤錯誤:「虛擬BOOL wxTopLevelWindowGTK ::展(布爾)」是不可訪問

/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’ 

我使用命令行編譯程序

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

並獲得以下錯誤日誌:Error Log

完整代碼:Source Code

回答

3
class MyFrame : wxFrame 

應該

class MyFrame : public wxFrame 

默認情況下,類的傳承是私有的。在錯誤消息'wxTopLevelWindowGTK'不是'MyFrame'的可訪問基礎是一個很好的描述出了什麼問題。

+0

謝謝約翰...... – twid