I'm trying to compile the examples against wxWidgets 3.0, and I am getting an error related to wx/log.h:
from mathplot.cpp
// This method updates the buffers m_trans_shape_xs/ys, and the precomputed bounding box.voidmpMovableObject::ShapeUpdated(){// Just in case...if(m_shape_xs.size()!=m_shape_ys.size()){::wxLogError(wxT("[mpMovableObject::ShapeUpdated] Error, m_shape_xs and m_shape_ys have different lengths!"));
For the last line, the error message I get is:
Infileincludedfrom/home/wo/Desktop/install/wxMathPlot/wxMathPlot-0.1.2/mathplot.cpp:36:0:/home/wo/Desktop/install/wxMathPlot/wxMathPlot-0.1.2/mathplot.cpp:Inmemberfunction'void mpMovableObject::ShapeUpdated()':/usr/include/wx-3.0/wx/log.h:1361:5:error:expectedid-expressionbefore'for'for(boolloopvar=false;\
^/usr/include/wx-3.0/wx/log.h:1367:5:note:inexpansionofmacro'wxDO_LOG_IF_ENABLED_HELPER'wxDO_LOG_IF_ENABLED_HELPER(level,wxMAKE_UNIQUE_NAME(wxlogcheck))^/usr/include/wx-3.0/wx/log.h:1374:20:note:inexpansionofmacro'wxDO_LOG_IF_ENABLED'#define wxLogError wxDO_LOG_IF_ENABLED(Error)^/home/wo/Desktop/install/wxMathPlot/wxMathPlot-0.1.2/mathplot.cpp:2610:11:note:inexpansionofmacro'wxLogError'::wxLogError(wxT("[mpMovableObject::ShapeUpdated] Error, m_shape_xs and m_shape_ys have different lengths!"));^/usr/include/wx-3.0/wx/log.h:1367:58:error:'wxlogcheck2610'wasnotdeclaredinthisscopewxDO_LOG_IF_ENABLED_HELPER(level,wxMAKE_UNIQUE_NAME(wxlogcheck))(...,lotsofconsecutiveerrorstofollow)
from wx/log.h (the error related code starts after the #else)
Seems it affects all calls to ::wxLogError...
When commenting them out, the code compiles.
I'm using the CodeLite IDE 9.1.0 and g++5 on Xubuntu 15.10. I created a project containing mathplot.h, mathplot.cpp and any one of the 3 examples (./samples/mp{1,2,3}.cpp).
Any suggestions for a real fix?
Thanks for advice!
Last edit: WoFo 2016-03-31
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Experts,
I'm trying to compile the examples against wxWidgets 3.0, and I am getting an error related to wx/log.h:
from mathplot.cpp
For the last line, the error message I get is:
from wx/log.h (the error related code starts after the #else)
Seems it affects all calls to ::wxLogError...
When commenting them out, the code compiles.
I'm using the CodeLite IDE 9.1.0 and g++5 on Xubuntu 15.10. I created a project containing mathplot.h, mathplot.cpp and any one of the 3 examples (./samples/mp{1,2,3}.cpp).
Any suggestions for a real fix?
Thanks for advice!
Last edit: WoFo 2016-03-31
In mathplot.cpp, change all references from "::wxLogError" to "wxLogError". This is because wxLogError is a macro rather than a function.