0

I have Eclipse C++ and integrated with it a long time ago MinGW. At some moment, I needed C++17's standard library functionality. I did Project -> Properties -> C/C++ build -> Settings -> GCC C++ Compiler -> Dialect and changed Language standard from *Whitespace* to ISO C++17 (-std=c++17). After that, the constant M_PI in <cmath> became invalid (isn't defined). This happens with every option I choose (except *Whitespace*). I've reinstalled & reintegrated MinGW.

Gordem
  • 115
  • 9
  • 2
    `M_PI` is not standard. See [How to use the PI constant in C++](https://stackoverflow.com/q/1727881/10077). – Fred Larson Jul 08 '20 at 14:49
  • 1
    Top answer calls for `M_PI` specifically. Top comment of the second answer is good, though. Another question is whether their version of MinGW supports C++17 properly. If it's relatively current, it likely does, but people love running around with ancient software. Not released to stable yet, but C++20 will have direct support for many mathematical constants, including pi. – sweenish Jul 08 '20 at 14:59
  • @sweenish GCC 10 has C++20 support. MinGW-w64 versions of GCC 10 for Windows can be found at http://winlibs.com/ – Brecht Sanders Jul 17 '20 at 21:08

0 Answers0