[英]How to use Mathplot in wxSmith(Code::Blocks) and wxWidgets
I am using wxSmith in Code::Blocks for a GUI application. 我在GUI应用程序的Code :: Blocks中使用wxSmith。 Everything is alright for creating basic wxWidgets components but I need to plot something within.
创建基本的wxWidgets组件一切都很好,但是我需要在其中进行一些绘制。
Thus, I have downloaded MathPlot, and copied both mathplot.h and mathplot.cpp to my project folder. 因此,我已经下载了MathPlot,并将mathplot.h和mathplot.cpp复制到了我的项目文件夹中。
There is this category 'mathplot' at the wxSmith's palette (at the bottom of the editor). wxSmith的面板(在编辑器的底部)有一个类别“ mathplot”。 I have selected the 'mpWindow' component, and added
#include "mathplot.h"
to my main.h file for parameters declaration etc. 我选择了“ mpWindow”组件,并将
#include "mathplot.h"
添加到了main.h文件中以进行参数声明等。
My problem here is I am getting the error message "undefined reference to mpWindow::mpWindow(wxWindow*, int, wxPoint const&, ...) eventhough the function is declared in 'mathplot.h' file that I have included. 我的问题是即使我在包含的'mathplot.h'文件中声明了该函数,我仍收到错误消息“对mpWindow :: mpWindow(wxWindow *,int,wxPoint const&,...)的未定义引用。
I could not find any source that shows a thorough procedures or example in using MathPlot in wxSmith or wxWidget. 我找不到在wxSmith或wxWidget中使用MathPlot的任何显示完整过程或示例的资源。
Thus, if anyone could help me with this, it will be much appreciated! 因此,如果有人可以帮助我,将不胜感激!
I am using wxWidgets 2.8.12. 我正在使用wxWidgets 2.8.12。
Just in case anybody is facing the same problem, this is what I have done to solve the problem. 万一有人遇到相同的问题,这就是我为解决问题所做的工作。 Copy both 'mathplot.cpp' and 'mathplot.h' to the project folder, and add both files to your project by selecting Project->Add files to project... in Code::Blocks.
将“ mathplot.cpp”和“ mathplot.h”都复制到项目文件夹,然后通过在Code :: Blocks中选择Project-> Add files to project ...将两个文件都添加到项目中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.