I have read many posts of how to build/use mathplot for wxWidgets but none of them is for mingw64 in windows.
I have most current source code of wxWidgets from git repo trunk (I think it is 3.1.5 using git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets.git) and I built the lib/dll for mswud (UNICODE=1 DEBUG=1) using mingw64.
Then I use Code::block to create dll project for mathplot, add mathplot.cpp and mathplot.h to the project.
I setup code::block enviroment such as search path for compiler and linker to wxWidgets include folder and lib/dll folders.
Which are in (here $(WSHOME) is the wxWidgets source folder. All built dll and lib files are in mswud folders)
$(WXHOME)\include
$(WXHOME)\lib\gcc_dll\mswud
$(WXHOME)\lib\gcc_lib\mswud
In linker settings I add all wxWidgets built dll and lib files to the project.
Then I try to compile the project. I got errors like those:
Code: Select all
In file included from F:\wxWidgets\include/wx/object.h:57,
from F:\wxWidgets\include/wx/event.h:16,
from F:\wxWidgets\include/wx/window.h:18,
from F:\wx\mathplot\mathplot.cpp:19:
F:\wx\mathplot\mathplot.cpp: At global scope:
F:\wx\mathplot\mathplot.cpp:492:25: error: no declaration matches 'wxObject* mpWindow::wxCreateObject()'
IMPLEMENT_DYNAMIC_CLASS(mpWindow, wxScrolledWindow)
^~~~~~~~
F:\wxWidgets\include/wx/rtti.h:187:15: note: in definition of macro 'wxIMPLEMENT_DYNAMIC_CLASS'
wxObject* name::wxCreateObject() \
^~~~
F:\wx\mathplot\mathplot.cpp:492:1: note: in expansion of macro 'IMPLEMENT_DYNAMIC_CLASS'
IMPLEMENT_DYNAMIC_CLASS(mpWindow, wxScrolledWindow)
^~~~~~~~~~~~~~~~~~~~~~~
F:\wx\mathplot\mathplot.cpp:492:25: note: no functions named 'wxObject* mpWindow::wxCreateObject()'
IMPLEMENT_DYNAMIC_CLASS(mpWindow, wxScrolledWindow)
^~~~~~~~
F:\wxWidgets\include/wx/rtti.h:187:15: note: in definition of macro 'wxIMPLEMENT_DYNAMIC_CLASS'
wxObject* name::wxCreateObject() \
^~~~
F:\wx\mathplot\mathplot.cpp:492:1: note: in expansion of macro 'IMPLEMENT_DYNAMIC_CLASS'
IMPLEMENT_DYNAMIC_CLASS(mpWindow, wxScrolledWindow)
^~~~~~~~~~~~~~~~~~~~~~~
In file included from F:\wx\mathplot\mathplot.cpp:42:
F:\wx\mathplot\mathplot.h:556:19: note: 'class mpWindow' defined here
class WXDLLEXPORT mpWindow : public wxScrolledWindow
^~~~~~~~
F:\wx\mathplot\mathplot.cpp:562:11: error: no declaration matches 'wxObject* mpWindow::wxCreateObject()'
wxObject* mpWindow::wxCreateObject()
^~~~~~~~
F:\wx\mathplot\mathplot.cpp:562:11: note: no functions named 'wxObject* mpWindow::wxCreateObject()'
In file included from F:\wx\mathplot\mathplot.cpp:42:
F:\wx\mathplot\mathplot.h:556:19: note: 'class mpWindow' defined here
class WXDLLEXPORT mpWindow : public wxScrolledWindow
^~~~~~~~
F:\wx\mathplot\mathplot.cpp: In member function 'void mpWindow::OnMouseMove(wxMouseEvent&)':
F:\wx\mathplot\mathplot.cpp:663:46: warning: 'wxPen::wxPen(const wxColour&, int, int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
wxPen pen(*wxLIGHT_GREY, 1, wxDOT);
^
In file included from F:\wxWidgets\include/wx/pen.h:103,
from F:\wxWidgets\include/wx/dc.h:25,
from F:\wxWidgets\include/wx/dcclient.h:12,
from F:\wx\mathplot\mathplot.cpp:38:
F:\wxWidgets\include/wx/msw/pen.h:61:5: note: declared here