[GRASS-dev] trouble compiling v.in.ogr + math.h (all branches)
hamish_b at yahoo.com
Sun Jun 9 13:00:42 PDT 2013
when I try to compile a fresh check out of 6.4.3svn on an older
system (glibc 2.3.6) I get this error from v.in.ogr:
main.c: In function 'main':
main.c:1208: error: implicit declaration of function 'log2'
main.c:1208: warning: incompatible implicit declaration of built-in function 'log2'
I thought it was because #include <math.h> was missing (for pow()
and log10() too), but after adding that I still get the error.
It turns out I need to add -std=c99 to the gcc line to get it
to work, but the glibc man page for log2() has it conforming to
SVr4, 4.3BSD, C89.
maybe I could replace it with a log()/log() trick, but would
pow() and log10() also be broken?
More information about the grass-dev