Has anyone implemented math.h in their apps; or more specifically, round()? I Copied math.h from my arduino libraries and pasted it into the web IDE, labeling it math.h; however, when I go to verify my code I get this response:
math.h:440:8: error: expected unqualified-id before 'double’
math.h:440:8: error: expected ‘)’ before 'double’
math.h:440:8: error: expected ‘)’ before ‘double’
The line it’s referring to is the round() function which is written as:
double round (double __x) __ATTR_CONST__;
All of the other functions seem fine, but this one, the one I need reports an error.
gaudsend, no need to copy the arduino library. Just put #include "math.h" at the top of your file and the web IDE will include the STM32 version of the math library.
I didn’t know math.h was already available. I think the issue was because I had the arduino version of the library pasted into the web IDE and when I used #include “math.h” it was including both…or perhaps the arduino one wasn’t entirely compatible. Regardless, I removed the pasted library and it works great.