I have the following code in my Eclipse project
#pragma once
#ifdef WIN32 // Compiler enters here !
#define M_PI 3.14159265358979323846
#else
#include <cmath>
#endif
#ifndef INFINITY
#define INFINITY FLT_MAX
#endif
inline float Radians(float deg)
{
return ((float)M_PI/180.f) * deg;
}
Problem is that I'm getting the following error from the compiler
Luzoso.hpp:22:20: error: 'M_PI' was not declared in this scope
return ((float)M_PI/180.f) * deg;
I don't understand what the problem might be. I built the project with CMake using ECLIPSE CDT4 - MinGW Makefiles
as the generator. Any advise?