error: use of undeclared identifier 'M_PI'
yurivict opened this issue · comments
yuri@FreeBSD commented
/usr/ports/misc/iio-oscilloscope/work/iio-oscilloscope-0.16-master/oscplot.c:898:20: error: use of undeclared identifier 'M_PI'
double a = 2.0 * M_PI / (n - 1);
^
/usr/ports/misc/iio-oscilloscope/work/iio-oscilloscope-0.16-master/oscplot.c:909:14: error: use of undeclared identifier 'M_PI'
double a = M_PI * j / (n - 1);
^
Removing -D_POSIX_C_SOURCE=200809L
removes these errors.
Version: 0.16
clang-15
FreeBSD 13.2
Jorge Marques commented
M_PI is defined in the the math.h header, check if your system defines them somewhere like /usr/include/math.h
, and if CMake is including the system headers properly.
yuri@FreeBSD commented
This looks like a system headers error.
Thank you for your help.
Dan Nechita commented
Closing this, then.