Using Matplotlib with wxWidgets C++

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 2999
Joined: Sun Jan 03, 2010 5:45 pm

Re: Using Matplotlib with wxWidgets C++

Post by PB » Sat Apr 10, 2021 2:52 pm

For the third time: Do not use the obsolete 0.1.2 version, use the trunk version of wxMatPlot from SourceForge I linked before. No changes are needed there.

As for those wxLogError()s, I obviously meant to remove the "::" in front of "wxLogError" in mathplot.cpp but once again, this is a moot point, see above.

hinet
Experienced Solver
Experienced Solver
Posts: 60
Joined: Mon Aug 08, 2016 9:44 am
Location: France
Contact:

Re: Using Matplotlib with wxWidgets C++

Post by hinet » Sat Apr 10, 2021 3:37 pm

PB wrote:
Sat Apr 10, 2021 2:52 pm
For the third time: Do not use the obsolete 0.1.2 version, use the trunk version of wxMatPlot from SourceForge I linked before. No changes are needed there.

As for those wxLogError()s, I obviously meant to remove the "::" in front of "wxLogError" in mathplot.cpp but once again, this is a moot point, see above.
Yes, Yes, Yes... I am using the https://sourceforge.net/p/wxmathplot/sv ... /mathplot/ snapshot code from Sourceforge as you recommended in the previous post.
This line of code doesn't have any "::" operator but still doesn't compile.

Code: Select all

wxLogError(wxT("[mpMovableObject::ShapeUpdated] Error, m_shape_xs and m_shape_ys have different lengths!"));
I comment this line and the project compiles and I don't know why? should I have to define any macro to use the logError routine?

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2999
Joined: Sun Jan 03, 2010 5:45 pm

Re: Using Matplotlib with wxWidgets C++

Post by PB » Sat Apr 10, 2021 4:52 pm

I do not see anything wrong with that line. What error do you get?

As I wrote, the trunk compiled for me both with MSVC and GCC out of the box. Is your wxWidgets installation alright? I did not understand the purpose of you attaching wxLog header in one of your previous posts, did you modify it?

hinet
Experienced Solver
Experienced Solver
Posts: 60
Joined: Mon Aug 08, 2016 9:44 am
Location: France
Contact:

Re: Using Matplotlib with wxWidgets C++

Post by hinet » Sat Apr 10, 2021 5:39 pm

PB wrote:
Sat Apr 10, 2021 4:52 pm
I do not see anything wrong with that line. What error do you get?

As I wrote, the trunk compiled for me both with MSVC and GCC out of the box. Is your wxWidgets installation alright? I did not understand the purpose of you attaching wxLog header in one of your previous posts, did you modify it?
Yes, I believe you. I am using mingw32 bit and I used this command to compile my wxWidgets API.
mingw32-make.exe -f makefile.gcc setup_h BUILD=debug SHARED=1 ......
I attched my header file log.h because I thought that I have to delete the "::" in this file.

-------------- Build: Debug in SeriaCommunication_3_1 (compiler: GNU GCC Compiler)---------------

g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -march=corei7 -std=gnu++14 -g -lpython3.9 -lboost_system -lboost_system-mt -D__WXDEBUG__ -DWITHOUT_NUMPY -IC:\wxWidgets-3.1.4\include -I..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\mswud\wx -I..\..\..\git\wxPyhtonSerialCommunication\SerialCommunicaiton\descode -IC:\wxWidgets-3.1.4\lib\gcc_dll\mswud -IC:\Python_3_9_4\Lib\site-packages\numpy\core\include -IC:\Python_3_9_4\include -I..\..\..\..\..\boost_1_72_0 -c C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp -o obj\Debug\Documents\Code_Blocks\SeriaCommunication\mathplot.o
g++.exe -LC:\wxWidgets-3.1.4\lib\gcc_dll -LC:\Python_3_9_4\libs -LC:\Python_3_9_4\include -L..\WxMathPloterExample\bin\Debug -LC:\boost_1_72_0\tools\build\boost_build\boost\bin.v2\libs -o bin\Debug\SeriaCommunication.exe obj\Debug\git\wxPyhtonSerialCommunication\SerialCommunicaiton\descode\MainFrame.o obj\Debug\Documents\Code_Blocks\SeriaCommunication\mathplot.o obj\Debug\Documents\Code_Blocks\SeriaCommunication\SeriaCommunicationApp.o obj\Debug\Documents\Code_Blocks\SeriaCommunication\SeriaCommunicationMain.o obj\Debug\Documents\Code_Blocks\SeriaCommunication\tserial.o obj\Debug\Documents\Code_Blocks\SeriaCommunication\resource.res -mthreads ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxbase31ud.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxbase31ud_net.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxbase31ud_xml.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxexpatd.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxjpegd.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_adv.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_aui.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_core.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_gl.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_html.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_media.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_propgrid.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_ribbon.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_richtext.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_stc.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_webview.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxmsw31ud_xrc.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxpngd.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxregexud.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxscintillad.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxtiffd.a ..\..\..\..\..\wxWidgets-3.1.4\lib\gcc_dll\libwxzlibd.a ..\..\..\..\..\Python_3_9_4\libs\python39.lib
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp: In member function 'wxBitmap mpLayer::GetColourSquare(int)':
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:95:34: warning: 'wxBrush::wxBrush(const wxColour&, int)' is deprecated: use wxBRUSHSTYLE_XXX constants [-Wdeprecated-declarations]
wxBrush brush(filler, wxSOLID);
^
In file included from C:\wxWidgets-3.1.4\include/wx/brush.h:73:0,
from C:\wxWidgets-3.1.4\include/wx/dc.h:24,
from C:\wxWidgets-3.1.4\include/wx/wx.h:50,
from C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:19:
C:\wxWidgets-3.1.4\include/wx/msw/brush.h:44:5: note: declared here
wxBrush(const wxColour& col, int style);
^~~~~~~
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp: In member function 'virtual void mpScaleX::Plot(wxDC&, mpWindow&)':
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:902:26: warning: 'void wxPen::SetStyle(int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
m_pen.SetStyle(wxDOT);
^
In file included from C:\wxWidgets-3.1.4\include/wx/pen.h:84:0,
from C:\wxWidgets-3.1.4\include/wx/dc.h:25,
from C:\wxWidgets-3.1.4\include/wx/wx.h:50,
from C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:19:
C:\wxWidgets-3.1.4\include/wx/msw/pen.h:62:10: note: declared here
void SetStyle(int style) { SetStyle((wxPenStyle)style); }
^~~~~~~~
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:913:28: warning: 'void wxPen::SetStyle(int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
m_pen.SetStyle(wxSOLID);
^
In file included from C:\wxWidgets-3.1.4\include/wx/pen.h:84:0,
from C:\wxWidgets-3.1.4\include/wx/dc.h:25,
from C:\wxWidgets-3.1.4\include/wx/wx.h:50,
from C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:19:
C:\wxWidgets-3.1.4\include/wx/msw/pen.h:62:10: note: declared here
void SetStyle(int style) { SetStyle((wxPenStyle)style); }
^~~~~~~~
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp: In member function 'virtual void mpScaleY::Plot(wxDC&, mpWindow&)':
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:1163:25: warning: 'void wxPen::SetStyle(int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
m_pen.SetStyle(wxDOT);
^
In file included from C:\wxWidgets-3.1.4\include/wx/pen.h:84:0,
from C:\wxWidgets-3.1.4\include/wx/dc.h:25,
from C:\wxWidgets-3.1.4\include/wx/wx.h:50,
from C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:19:
C:\wxWidgets-3.1.4\include/wx/msw/pen.h:62:10: note: declared here
void SetStyle(int style) { SetStyle((wxPenStyle)style); }
^~~~~~~~
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:1174:27: warning: 'void wxPen::SetStyle(int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
m_pen.SetStyle(wxSOLID);
^
In file included from C:\wxWidgets-3.1.4\include/wx/pen.h:84:0,
from C:\wxWidgets-3.1.4\include/wx/dc.h:25,
from C:\wxWidgets-3.1.4\include/wx/wx.h:50,
from C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:19:
C:\wxWidgets-3.1.4\include/wx/msw/pen.h:62:10: note: declared here
void SetStyle(int style) { SetStyle((wxPenStyle)style); }
^~~~~~~~
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp: In member function 'void mpWindow::OnMouseMove(wxMouseEvent&)':
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:1424:45: warning: 'wxPen::wxPen(const wxColour&, int, int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
wxPen pen(*wxBLACK, 1, wxDOT);
^
In file included from C:\wxWidgets-3.1.4\include/wx/pen.h:84:0,
from C:\wxWidgets-3.1.4\include/wx/dc.h:25,
from C:\wxWidgets-3.1.4\include/wx/wx.h:50,
from C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:19:
C:\wxWidgets-3.1.4\include/wx/msw/pen.h:59:5: note: declared here
wxPen(const wxColour& col, int width, int style);
^~~~~
In file included from C:\wxWidgets-3.1.4\include/wx/wx.h:23:0,
from C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:19:
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp: In member function 'void mpPolygon::setPoints(const std::vector<double>&, const std::vector<double>&, bool)':
C:\wxWidgets-3.1.4\include/wx/log.h:1261:36: error: 'wxDO_IF' was not declared in this scope
wxDO_IF(wxLOG_IS_ENABLED(level)) \
^

C:\wxWidgets-3.1.4\include/wx/log.h:1273:20: note: in expansion of macro 'wxDO_LOG_IF_ENABLED'
#define wxLogError wxDO_LOG_IF_ENABLED(Error)
^~~~~~~~~~~~~~~~~~~
C:\Users\---------\Documents\Code_Blocks\SeriaCommunication\mathplot.cpp:2976:9: note: in expansion of macro 'wxLogError'
wxLogError(wxT("[mpPolygon] Error: points_xs and points_ys must have the same number of elements"));

^
Process terminated with status 1 (0 minute(s), 3 second(s))
2 error(s), 6 warning(s) (0 minute(s), 3 second(s))


[/code]

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2999
Joined: Sun Jan 03, 2010 5:45 pm

Re: Using Matplotlib with wxWidgets C++

Post by PB » Sat Apr 10, 2021 6:10 pm

The error looks like the one when wxLogError() was prefixed with "::".

The build command line looks odd to me (is all the stuff included really needed) but I don't really see how build options could affect this. Assuming you are actually using the trunk version but if you were not, you would get more errors....

I have no idea what is going wrong, I would try a new empty project with just wxWidgets and wxMathPlot, using e.g. one of its samples as the test code and just including the mathplot.h and mathplot.cpp and source files instead of building them as the library. I did this in Code::Blocks and all went well as expected (I was building the library and samples using CMake before):

Code: Select all

-------------- Build: Release in Test (compiler: msys2-mingw-w64-i686)---------------

g++.exe -Wall -std=c++17 -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -O2 -DNDEBUG -ID:\Dev\Desktop\!Lib\wxWidgets-GIT\include -ID:\Dev\Desktop\!Lib\wxWidgets-GIT\lib\gcc_dll\mswu -c C:\dev\myapps\Test-Mathplotlib\mathplot.cpp -o obj\Release\mathplot.o
g++.exe -Wall -std=c++17 -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -O2 -DNDEBUG -ID:\Dev\Desktop\!Lib\wxWidgets-GIT\include -ID:\Dev\Desktop\!Lib\wxWidgets-GIT\lib\gcc_dll\mswu -c C:\dev\myapps\Test-Mathplotlib\mp1.cpp -o obj\Release\mp1.o
windres.exe -ID:\Dev\Desktop\!Lib\wxWidgets-GIT\include -ID:\Dev\Desktop\!Lib\wxWidgets-GIT\lib\gcc_dll\mswu -DwxUSE_DPI_AWARE_MANIFEST=1  -J rc -O coff -i C:\dev\myapps\TEST-M~1\resource.rc -o obj\Release\resource.res
g++.exe -LD:\Dev\Desktop\!Lib\wxWidgets-GIT\lib\gcc_dll -o bin\Release\Test.exe obj\Release\mathplot.o obj\Release\mp1.o  obj\Release\resource.res -s -mthreads  -lwxmsw31u_richtext -lwxmsw31u_xrc -lwxmsw31u_aui -lwxmsw31u_media -lwxbase31u_net -lwxmsw31u_gl -lwxbase31u_xml -lwxmsw31u_adv -lwxmsw31u_html -lwxmsw31u_core -lwxbase31u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lwxregexu -lwxexpat -mwindows
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp: In member function 'wxBitmap mpLayer::GetColourSquare(int)':
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:95:34: warning: 'wxBrush::wxBrush(const wxColour&, int)' is deprecated: use wxBRUSHSTYLE_XXX constants [-Wdeprecated-declarations]
   95 |     wxBrush brush(filler, wxSOLID);
      |                                  ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/brush.h:73,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:24,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:19:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/brush.h:44:5: note: declared here
   44 |     wxBrush(const wxColour& col, int style);
      |     ^~~~~~~
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp: In member function 'virtual void mpScaleX::Plot(wxDC&, mpWindow&)':
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:902:26: warning: 'void wxPen::SetStyle(int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
  902 |      m_pen.SetStyle(wxDOT);
      |                          ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/pen.h:103,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:25,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:19:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/pen.h:64:10: note: declared here
   64 |     void SetStyle(int style) { SetStyle((wxPenStyle)style); }
      |          ^~~~~~~~
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:913:28: warning: 'void wxPen::SetStyle(int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
  913 |      m_pen.SetStyle(wxSOLID);
      |                            ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/pen.h:103,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:25,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:19:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/pen.h:64:10: note: declared here
   64 |     void SetStyle(int style) { SetStyle((wxPenStyle)style); }
      |          ^~~~~~~~
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp: In member function 'virtual void mpScaleY::Plot(wxDC&, mpWindow&)':
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:1163:25: warning: 'void wxPen::SetStyle(int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
 1163 |     m_pen.SetStyle(wxDOT);
      |                         ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/pen.h:103,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:25,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:19:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/pen.h:64:10: note: declared here
   64 |     void SetStyle(int style) { SetStyle((wxPenStyle)style); }
      |          ^~~~~~~~
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:1174:27: warning: 'void wxPen::SetStyle(int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
 1174 |     m_pen.SetStyle(wxSOLID);
      |                           ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/pen.h:103,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:25,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:19:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/pen.h:64:10: note: declared here
   64 |     void SetStyle(int style) { SetStyle((wxPenStyle)style); }
      |          ^~~~~~~~
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp: In member function 'void mpWindow::OnMouseMove(wxMouseEvent&)':
C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:1424:45: warning: 'wxPen::wxPen(const wxColour&, int, int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
 1424 |                 wxPen pen(*wxBLACK, 1, wxDOT);
      |                                             ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/pen.h:103,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:25,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mathplot.cpp:19:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/pen.h:61:5: note: declared here
   61 |     wxPen(const wxColour& col, int width, int style);
      |     ^~~~~
C:\dev\myapps\Test-Mathplotlib\mp1.cpp: In constructor 'MyFrame::MyFrame()':
C:\dev\myapps\Test-Mathplotlib\mp1.cpp:240:37: warning: 'wxPen::wxPen(const wxColour&, int, int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
  240 |  wxPen vectorpen(*wxBLUE, 2, wxSOLID);
      |                                     ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/pen.h:103,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:25,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mp1.cpp:9:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/pen.h:61:5: note: declared here
   61 |     wxPen(const wxColour& col, int width, int style);
      |     ^~~~~
C:\dev\myapps\Test-Mathplotlib\mp1.cpp:265:49: warning: 'wxBrush::wxBrush(const wxColour&, int)' is deprecated: use wxBRUSHSTYLE_XXX constants [-Wdeprecated-declarations]
  265 |     wxBrush hatch(wxColour(200,200,200), wxSOLID);
      |                                                 ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/brush.h:73,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:24,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mp1.cpp:9:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/brush.h:44:5: note: declared here
   44 |     wxBrush(const wxColour& col, int style);
      |     ^~~~~~~
C:\dev\myapps\Test-Mathplotlib\mp1.cpp:269:50: warning: 'wxBrush::wxBrush(const wxColour&, int)' is deprecated: use wxBRUSHSTYLE_XXX constants [-Wdeprecated-declarations]
  269 |     wxBrush hatch2(wxColour(163,208,212), wxSOLID);
      |                                                  ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/brush.h:73,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:24,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mp1.cpp:9:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/brush.h:44:5: note: declared here
   44 |     wxBrush(const wxColour& col, int style);
      |     ^~~~~~~
C:\dev\myapps\Test-Mathplotlib\mp1.cpp:276:35: warning: 'wxPen::wxPen(const wxColour&, int, int)' is deprecated: use wxPENSTYLE_XXX constants [-Wdeprecated-declarations]
  276 |     wxPen mypen(*wxRED, 5, wxSOLID);
      |                                   ^
In file included from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/pen.h:103,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/dc.h:25,
                 from D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/wx.h:50,
                 from C:\dev\myapps\Test-Mathplotlib\mp1.cpp:9:
D:\Dev\Desktop\!Lib\wxWidgets-GIT\include/wx/msw/pen.h:61:5: note: declared here
   61 |     wxPen(const wxColour& col, int width, int style);
      |     ^~~~~
C:\dev\myapps\Test-Mathplotlib\mp1.cpp: In member function 'void MyFrame::OnAlignXAxis(wxCommandEvent&)':
C:\dev\myapps\Test-Mathplotlib\mp1.cpp:326:12: warning: unused variable 'yaxis' [-Wunused-variable]
  326 |  mpScaleY* yaxis = ((mpScaleY*)(m_plot->GetLayer(1)));
      |            ^~~~~
C:\dev\myapps\Test-Mathplotlib\mp1.cpp: In member function 'void MyFrame::OnAlignYAxis(wxCommandEvent&)':
C:\dev\myapps\Test-Mathplotlib\mp1.cpp:365:12: warning: unused variable 'xaxis' [-Wunused-variable]
  365 |  mpScaleX* xaxis = ((mpScaleX*)(m_plot->GetLayer(0)));
      |            ^~~~~
Output file is bin\Release\Test.exe with size 245.50 KB
Process terminated with status 0 (0 minute(s), 6 second(s))
0 error(s), 12 warning(s) (0 minute(s), 6 second(s))

hinet
Experienced Solver
Experienced Solver
Posts: 60
Joined: Mon Aug 08, 2016 9:44 am
Location: France
Contact:

Re: Using Matplotlib with wxWidgets C++

Post by hinet » Sat Apr 10, 2021 9:18 pm

I compiled my wxWidgets using this command and everything is good wxPlot compiles out of the box, no issues with wxLogError().
mingw32-make -f -j8 makefile.gcc SHARED=1 UNICODE=1 BUILD=release clean
mingw32-make -f -j8 makefile.gcc SHARED=1 UNICODE=1 BUILD=release

mingw32-make -f -j8 makefile.gcc SHARED=1 UNICODE=1 BUILD=debug clean
mingw32-make -f -j8 makefile.gcc SHARED=1 UNICODE=1 BUILD=debug
Thank you, PB,
Regards,

Post Reply