-
-
Notifications
You must be signed in to change notification settings - Fork 34
Description
For a full discussion of this issue see: https://forum.arduino.cc/t/another-quick-question-m-pi-not-defined-when-running-sketch-in-applab/1411094/5
While testing out Arduino Q I tried compiling the DFRobot BMMI150 library through Arduino IDE 2 and applab. While the sketch I used compiled and ran fine on IDE 2 it failed to compile on AppLab with the error message:
/home/arduino/.arduino15/internal/DFRobot_BMM150_1.0.0_98c1a4170799e41f/DFRobot_BMM150/DFRobot_BMM150.cpp:229:26: error: 'M_PI' was not declared in this scope
229 | return compass * 180 / M_PI;
@per1234 suggested adding -D_XOPEN_SOURCE=700 flag to the platform's compilation command patterns which I did and the sketch then compiled and ran without issues.
Suggest this be added to compile flags but not sure if it needs to be done here or through applab or someplace else.
If added it would help in not having to modify the libraries that use this or the sketches that may use things like M_PI. Help in compatibility