On Tue, 31 Mar 2015 18:48:00 -0700 (PDT) Yili Zhao wrote:
YZ> Hi,
YZ> when compiling an app with wxWidgets 3.0.2 by Visual Studio 2013, there
YZ> is a warning:
YZ>
YZ> c:\program files (x86)\microsoft visual studio
YZ> 12.0\vc\include\math.h(1298): warning C4005: “M_PI”: macro redefined
YZ> 1> d:\sdk\wxwidgets-3.0.2\include\wx\math.h(21) : see previous
YZ> definition of 'M_PI'
YZ>
YZ> // wxWidgets's math.h
YZ>
YZ> #include <math.h>
YZ>
YZ> #ifndef M_PI
YZ> #define M_PI 3.1415926535897932384626433832795
YZ> #endif
YZ>
YZ> In VS math.h, there is : #define M_PI 3.14159265358979323846
YZ>
YZ> So it should not generate this warning, but it did.
YZ>
YZ> How can I solve this issue?
You must be defining _USE_MATH_DEFINES somewhere (see the condition around
M_PI definition in <math.h>). Either don't do it at all, or do it before
including wx headers.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/