I can't compile my project that uses a atan2 function.
my code looks like this (I 've added #include <math.h>) :
double avgWindDir;
double a=sumEastWest;
double b=sumNorthSouth;
avgWindDir = atan2(a, b);
The error is
/user_main.c:70: undefined reference to `atan2'
If for example I set :
double a=1;
double b=2;
it compiles ok.
I 've searched some other forums about this and they say it's a linker error and the solution is to add -lm to linker options.
Where is the correct place to add this option ?