作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试编译 wxWidgets 第一个示例命令行,并出现以下错误
/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
最佳答案
class MyFrame : wxFrame
应该是
class MyFrame : public wxFrame
默认类继承是私有(private)的。在错误消息中,‘wxTopLevelWindowGTK’ is not an accessible base of ‘MyFrame’ 很好地描述了出现的问题。
关于c++ - 错误 : ‘virtual bool wxTopLevelWindowGTK::Show(bool)’ is inaccessible,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19218363/
我正在尝试编译 wxWidgets 第一个示例命令行,并出现以下错误 /usr/local/include/wx-3.0/wx/gtk/toplevel.h: In member function ‘
我是一名优秀的程序员,十分优秀!