When I compile the code below, I got these error messages:
(Error 1 error C2065: \'M_PI\' : undeclared identifier 2 IntelliSense: identifier \"M_PI\"
math.h does not define M_PI by default.
math.h
M_PI
So go with this:
#ifndef M_PI #define M_PI 3.14159265358979323846 #endif
This will handle both cases either your header have M_PI defined or not.