Build error in MS Visual Studio

Help
2011-06-07
2013-05-02
  • Vipul Arora
    Vipul Arora
    2011-06-07

    Hi,

    I am using MS Visual Studio 2008 on Windows XP.
    I have wxWidgets 2.9.1.
    I have installed wxMathPlot-0.1.2 using CMake:
    Source Code: /wxMathPlot
    where to build binaries: /wxMathPlot/build

    Now, when I try to build the wxMathPlot project in /wxMathPlot/build, it gives a long list of errors as follows:

    1>---- Build started: Project: mathplot, Configuration: Debug Win32 ----
    1>Compiling…
    1>mathplot.cpp
    1>..\mathplot.cpp(2239) : warning C4996: 'wxImage::SaveFile': was declared deprecated
    1>        D:\wxWidgets-2.9.1\include\wx/image.h(561) : see declaration of 'wxImage::SaveFile'
    1>..\mathplot.cpp(2422) : error C3861: 'wxLOG_wxGetTranslation': identifier not found
    1>..\mathplot.cpp(2422) : error C2228: left of '.Log' must have class/struct/union
    1>..\mathplot.cpp(2422) : error C3861: 'wxLOG_wxGetTranslation': identifier not found
    1>..\mathplot.cpp(2610) : error C2589: 'if' : illegal token on right side of '::'
    1>..\mathplot.cpp(2610) : error C2143: syntax error : missing ';' before '::'
    1>..\mathplot.cpp(2610) : error C2143: syntax error : missing ';' before '{'
    1>..\mathplot.cpp(2610) : error C2181: illegal else without matching if
    1>..\mathplot.cpp(2610) : error C2065: 'wxLOG_L' : undeclared identifier
    1>..\mathplot.cpp(2610) : error C2143: syntax error : missing ')' before 'string'
    1>..\mathplot.cpp(2610) : error C2059: syntax error : ')'
    1>..\mathplot.cpp(2749) : error C2589: 'if' : illegal token on right side of '::'
    1>..\mathplot.cpp(2749) : error C2143: syntax error : missing ';' before '::'
    1>..\mathplot.cpp(2749) : error C2143: syntax error : missing ';' before '{'
    1>..\mathplot.cpp(2749) : error C2181: illegal else without matching if
    1>..\mathplot.cpp(2749) : error C2065: 'wxLOG_L' : undeclared identifier
    1>..\mathplot.cpp(2749) : error C2143: syntax error : missing ')' before 'string'
    1>..\mathplot.cpp(2749) : error C2059: syntax error : ')'
    1>..\mathplot.cpp(2750) : error C2589: 'if' : illegal token on right side of '::'
    1>..\mathplot.cpp(2750) : error C2143: syntax error : missing ';' before '::'
    1>..\mathplot.cpp(2750) : error C2143: syntax error : missing ';' before '{'
    1>..\mathplot.cpp(2750) : error C2181: illegal else without matching if
    1>..\mathplot.cpp(2750) : error C2065: 'wxLOG_L' : undeclared identifier
    1>..\mathplot.cpp(2750) : error C2143: syntax error : missing ')' before 'string'
    1>..\mathplot.cpp(2750) : error C2059: syntax error : ')'
    1>..\mathplot.cpp(2751) : error C2589: 'if' : illegal token on right side of '::'
    1>..\mathplot.cpp(2751) : error C2143: syntax error : missing ';' before '::'
    1>..\mathplot.cpp(2751) : error C2143: syntax error : missing ';' before '{'
    1>..\mathplot.cpp(2751) : error C2181: illegal else without matching if
    1>..\mathplot.cpp(2751) : error C2065: 'wxLOG_L' : undeclared identifier
    1>..\mathplot.cpp(2751) : error C2143: syntax error : missing ')' before 'string'
    1>..\mathplot.cpp(2751) : error C2059: syntax error : ')'
    1>..\mathplot.cpp(2763) : error C2589: 'if' : illegal token on right side of '::'
    1>..\mathplot.cpp(2763) : error C2143: syntax error : missing ';' before '::'
    1>..\mathplot.cpp(2763) : error C2143: syntax error : missing ';' before '{'
    1>..\mathplot.cpp(2763) : error C2181: illegal else without matching if
    1>..\mathplot.cpp(2763) : error C2065: 'wxLOG_L' : undeclared identifier
    1>..\mathplot.cpp(2763) : error C2143: syntax error : missing ')' before 'string'
    1>..\mathplot.cpp(2763) : error C2059: syntax error : ')'
    1>..\mathplot.cpp(2847) : error C2589: 'if' : illegal token on right side of '::'
    1>..\mathplot.cpp(2847) : error C2143: syntax error : missing ';' before '::'
    1>..\mathplot.cpp(2847) : error C2143: syntax error : missing ';' before '{'
    1>..\mathplot.cpp(2847) : error C2181: illegal else without matching if
    1>..\mathplot.cpp(2847) : error C2065: 'wxLOG_L' : undeclared identifier
    1>..\mathplot.cpp(2847) : error C2143: syntax error : missing ')' before 'string'
    1>..\mathplot.cpp(2847) : error C2059: syntax error : ')'
    1>..\mathplot.cpp(2877) : error C2589: 'if' : illegal token on right side of '::'
    1>..\mathplot.cpp(2877) : error C2143: syntax error : missing ';' before '::'
    1>..\mathplot.cpp(2877) : error C2143: syntax error : missing ';' before '{'
    1>..\mathplot.cpp(2877) : error C2181: illegal else without matching if
    1>..\mathplot.cpp(2877) : error C2065: 'wxLOG_L' : undeclared identifier
    1>..\mathplot.cpp(2877) : error C2143: syntax error : missing ')' before 'string'
    1>..\mathplot.cpp(2877) : error C2059: syntax error : ')'
    1>Build log was saved at "file://d:\wxMathPlot-0.1.2\build\mathplot.dir\Debug\BuildLog.htm"
    1>mathplot - 52 error(s), 1 warning(s)
    2>---- Build started: Project: mpSample1, Configuration: Debug Win32 ----
    3>---- Build started: Project: mpSample2, Configuration: Debug Win32 ----
    4>---- Build started: Project: mpSample3, Configuration: Debug Win32 ----
    3>Linking…
    4>Linking…
    2>Linking…
    2>LINK : fatal error LNK1104: cannot open file '..\..\Debug\mathplot.lib'
    3>LINK : fatal error LNK1104: cannot open file '..\..\Debug\mathplot.lib'
    4>LINK : fatal error LNK1104: cannot open file '..\..\Debug\mathplot.lib'
    3>Build log was saved at "file://d:\wxMathPlot-0.1.2\build\samples\sample2\mpSample2.dir\Debug\BuildLog.htm"
    3>mpSample2 - 1 error(s), 0 warning(s)
    2>Build log was saved at "file://d:\wxMathPlot-0.1.2\build\samples\sample1\mpSample1.dir\Debug\BuildLog.htm"
    2>mpSample1 - 1 error(s), 0 warning(s)
    4>Build log was saved at "file://d:\wxMathPlot-0.1.2\build\samples\sample3\mpSample3.dir\Debug\BuildLog.htm"
    4>mpSample3 - 1 error(s), 0 warning(s)
    5>---- Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ----
    5>Project not selected to build for this solution configuration
    ========== Build: 0 succeeded, 4 failed, 1 up-to-date, 1 skipped ==========

    Kindly help in resolving the error and successfully using wxMathPlot.

    Thanks and regards,
    -Vipul

     
  • cdron77
    cdron77
    2011-06-07

    It look like that some code used in wxMathPlot is not compatible with wxWidgets 2.9. wxMathPlot is still untested under 2.9.x. I will check this, and eventually release a bugfix as soon as possible. Try using wxWidgets 2.8.x in the meanwhile.

    cdron77

     
  • James Bremner
    James Bremner
    2012-02-29

    I also hit this problem.

    I fixed it by editing mathplot.cpp, removing all the :: from in front of the calls to wxLogError

    James