【发布时间】:2018-02-24 18:08:21
【问题描述】:
我正在使用带有 wxWidgets 的 Code::Blocks。一般来说,我有一个类似于here 描述的问题。好的,所以我将mathplot.h 和mathplot.cpp 复制到项目目录中,将这些文件添加到项目中并在所有自动生成的(非空项目)wxWidgets cpp 文件中执行#include mathplot.h。然而,当我尝试编译时,它给了我错误:
/usr/include/wx-3.1-unofficial/wx/string.h|303|error: ‘wxString::wxString(int)’ is private|
如何解决这个问题并最终在 code::blocks 中使用 wxMathPlot?
这是与错误相关的编译器日志:
/usr/include/wx-3.1-unofficial/wx/string.h: In member function ‘bool mpWindow::SaveScreenshot(const wxString&, int, wxSize, bool)’:
/usr/include/wx-3.1-unofficial/wx/string.h:303:3: error: ‘wxString::wxString(int)’ is private
wxString(int);
/home/pekov/Workshop/Code::Blocks/tester/mathplot.cpp:2239:47: error: within this context
return screenImage.SaveFile(filename, type);
【问题讨论】:
-
@ravenspoint 我在
test_App.cpp和test_Main.cpp中添加了#include mathplot.h,它们是在code::blocks 中为非空wxWidget 项目(称为test)自动生成的,它们也有相应的.h 文件.然而,当我只添加mathpot.h和mathplot.cpp文件并且不在任何地方使用#include mathplot.h时,项目无法编译。 -
"'wxString::wxString(int)' 是私有的|"应该有更多信息,特别是“在这种情况下需要”。请发布您的编译器提供的所有信息。
-
是的,我记得这个。 mpWindow::SaveScreenshot() 不再有效。将添加我的“修复”
标签: codeblocks wxwidgets wxmathplot