Menu

M_PI

Help
2016-02-09
2016-02-10
  • Phil Rosenberg

    Phil Rosenberg - 2016-02-09

    Hi
    I am building nco on Cygwin as the binaries seem a long way out of date.

    I do a ./configure, then make. I am getting lots of errors saying M_PI is undeclared. I notice that the gcc calls use -std=c99, C99 does not include definitions of the mathematical constants like M_PI, so these need to be defined within the project.

     
  • Charlie Zender

    Charlie Zender - 2016-02-09

    I thought math.h always defined M_PI. Clearly it doesn't on Cygwin. It appears to everywhere else. As you say, this is patch-able. Will post again when resolved.

     
  • Phil Rosenberg

    Phil Rosenberg - 2016-02-10

    Not sure it is everywhere, perhaps it depends on the GCC version. See, e.g. http://ubuntuforums.org/showthread.php?t=583094
    I seem to remember on visual studio you also have to add a specific #define before including the math libraries to get it too.

    Anyway, thanks for looking into it

    Phil

     

Log in to post a comment.

MongoDB Logo MongoDB