diff --git a/libraries/AP_HAL/AP_HAL_Macros.h b/libraries/AP_HAL/AP_HAL_Macros.h index f0c6f1bca7..99bd7c042c 100644 --- a/libraries/AP_HAL/AP_HAL_Macros.h +++ b/libraries/AP_HAL/AP_HAL_Macros.h @@ -13,6 +13,9 @@ #define ALLOW_DOUBLE_MATH_FUNCTIONS #endif +// we need to include math.h here for newer compilers (eg. g++ 7.3.1 for stm32) +#include + #if !defined(ALLOW_DOUBLE_MATH_FUNCTIONS) /* give warnings if we use double precision maths functions without specifying ALLOW_DOUBLE_TRIG_FUNCTIONS. Code should use the