问题描述
我在Code :: Blocks中为GUI应用程序使用wxSmith.创建基本的wxWidgets组件一切都很好,但是我需要在其中进行一些绘制.
I am using wxSmith in Code::Blocks for a GUI application. Everything is alright for creating basic wxWidgets components but I need to plot something within.
因此,我已经下载了MathPlot,并将mathplot.h和mathplot.cpp复制到了我的项目文件夹中.
Thus, I have downloaded MathPlot, and copied both mathplot.h and mathplot.cpp to my project folder.
wxSmith的面板(在编辑器的底部)有一个类别"mathplot".我选择了"mpWindow"组件,并添加了 #include "mathplot.h"
到我的main.h文件中以进行参数声明等.
There is this category 'mathplot' at the wxSmith's palette (at the bottom of the editor). I have selected the 'mpWindow' component, and added #include "mathplot.h"
to my main.h file for parameters declaration etc.
我的问题是即使我在'mathplot.h'文件中声明了该函数,我仍收到错误消息对mpWindow :: mpWindow(wxWindow *,int,wxPoint const& ;, ...)的未定义引用包括在内.
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.
我找不到在wxSmith或wxWidget中使用MathPlot的完整过程或示例的任何资料.
I could not find any source that shows a thorough procedures or example in using MathPlot in wxSmith or wxWidget.
因此,如果有人可以帮助我,将不胜感激!
Thus, if anyone could help me with this, it will be much appreciated!
我正在使用wxWidgets 2.8.12.
I am using wxWidgets 2.8.12.
推荐答案
只要有人遇到相同的问题,这就是我为解决问题所做的工作.将'mathplot.cpp'和'mathplot.h'复制到项目文件夹,然后通过在Code :: Blocks中选择Project-> Add files to project ...,将这两个文件添加到您的项目中.
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.
这篇关于如何在wxSmith(Code :: Blocks)和wxWidgets中使用Mathplot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!