我使用w :: widgets的Code :: Blocks。一般来说,我有一个类似于here的问题。好的,我将mathplot.h
和mathplot.cpp
复制到项目目录中,将这些文件添加到项目中,并在所有自动生成的(非空项目)wxWidgets cpp文件中执行#include mathplot.h
。然而,当我尝试编译它给我的错误:使用wxMathplot和代码:: blocks
/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项目(称为测试)自动生成的,它们也具有相应的.h文件。不过,当我仅添加'mathpot.h'和'mathplot.cpp'文件并且不在任何地方使用'#include mathplot.h'时,该项目不会编译。 – Pekov
“'wxString :: wxString(int)'是private |”应该有更多的信息,特别是“在这方面需要”。请发布您的编译器提供的所有信息。 – ravenspoint
是的,我记得这一点。 mpWindow :: SaveScreenshot()不再有效。将添加我的“修复” – ravenspoint