sparkfun/SparkFun_BME280_Arduino_Library

SparkFunBME280.cpp:410:37: error: ‘pow’ was not declared in this scope

jdavid opened this issue · 0 comments

There are several calls to math functions (pow, log, log10) but math.h is not included.

This is not an issue with Arduino probably because math.h is included somewhere else. But I'm trying to use this library with RIOT-OS, which has an Arduino compatibility module and I get a number of errors like:

error: ‘pow’ was not declared in this scope

For now I'll have to apply a patch, but it would be cool to be able to use this library without modifications. This is the patch I'm going to use:

--- SparkFunBME280.cpp	2020-10-23 18:52:48.971574912 +0200
+++ SparkFunBME280_math.cpp	2020-10-23 19:08:15.968040892 +0200
@@ -20,6 +20,7 @@
 ******************************************************************************/
 //See SparkFunBME280.h for additional topology notes.
 
+#include <math.h>
 #include "SparkFunBME280.h"
 
 //****************************************************************************//