将 wxMathplot 与 code::blocks 一起使用

Using wxMathplot with code::blocks

我正在使用 Code::Blocks 和 wxWidgets。总的来说,我遇到的问题与 here 中描述的类似。好的,所以我将 mathplot.hmathplot.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);

mpWindow::SaveScreenshot() 不再有效。由于我不使用该功能,所以我只是将最后一行注释掉

//    return screenImage.SaveFile(filename, type);

这允许我的项目编译和使用其他功能。

看来您使用的wxMathPlot版本已经很久没有维护了。或许您应该尝试下载看起来更新的 the version on github,看看您是如何处理的。