Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Arduino Q: Sketches using libraries with M_PI fail to compile in App Lab #236

Open
Labels
bugSomething isn't working
@mjs513

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /