In my unmanaged C ++ source, I have:
#define _USE_MATH_DEFINES #include <cmath>
and then I use M_PI a couple of times. Compilation in Debug configuration works flawlessly, but in Release it gives:
error C2065: "M_PI": undeclared identifier
What could be the configuration property causing this?
solvable.
I put
#define _USE_MATH_DEFINES
before
#include "stdafx.h"
With Precompiled Headers on (/ Yu), as in Release mode, everything above it is ignored.
The following code compiles for both debugging and release for me:
#define _USE_MATH_DEFINES #include <cmath> int main(void) { double x = M_PI; return 0; }
. ?
Watch out for differences in Debug and Release configurations:
The most important thing: