简体   繁体   中英

Errors Compiling wxMathPlot

this is following on from this question posted previously:

How to build wxmathPlot for win32?

The best answer says to just add the mathplot.h and mathplot.cpp files to your project and then it should work.

however, after I add these 2 files to my project in visual studios 2010 (by right-clicking my project->add->existing item and selecting the 2 files) and try to compile, I get the following errors:

1>  mathplot.cpp
1>mathplot.cpp(133): warning C4100: 'event' : unreferenced formal parameter
1>mathplot.cpp(133): warning C4100: 'w' : unreferenced formal parameter
1>mathplot.cpp(278): warning C4100: 'event' : unreferenced formal parameter
1>mathplot.cpp(278): warning C4100: 'w' : unreferenced formal parameter
1>mathplot.cpp(2239): warning C4996: 'wxImage::SaveFile': was declared deprecated
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(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(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(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(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(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(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

how can I fix this?

In mathplot.cpp file, I have changed all ::wxLogError with wxLogError

and comment out the line #define new DEBUG_NEW , then it compiles successfully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM