[BUG&FIX] error: '__builtin_isfinite' is not a member of 'std'
Posted: Fri Oct 26, 2018 8:52 pm
using GCC 7.2.0 - on linux, I get a compile error; error: '__builtin_isfinite' is not a member of 'std'. googling this led me to a workaround:
The Fix:
tc@box:~/src/ContextFree$ CPPFLAGS=-D_GLIBCXX_USE_C99_MATH=1 make
The Error:
tc@box:~/src/ContextFree$ make
[...]
g++ -Isrc-common -Isrc-unix -Iobjs -Isrc-common/agg-extras -Isrc-ffmpeg/include -I/usr/local/include -Isrc-agg -Isrc-agg/agg2 -O2 -Wall -Wextra -march=native -Wno-parentheses -std=c++14 -c -o objs/cfdg.tab.o objs/cfdg.tab.cpp
In file included from /tmp/tcloop/gcc/usr/local/include/c++/7.2.0/cmath:45:0,
from /tmp/tcloop/gcc/usr/local/include/c++/7.2.0/math.h:36,
from src-agg/agg2/agg_math.h:22,
from src-agg/agg2/agg_math_stroke.h:23,
from src-common/ast.h:32,
from src-common/astreplacement.h:29,
from src-common/cfdg.ypp:64:
src-common/bounds.h: In member function 'bool Bounds::valid() const':
src-common/bounds.h:41:23: error: '__builtin_isfinite' is not a member of 'std'
#define myfinite std::isfinite
^
src-common/bounds.h:59:37: note: in expansion of macro 'myfinite'
bool valid() const { return myfinite(mMin_X) && myfinite(mMax_X) &&
^~~~~~~~
src-common/bounds.h:41:23: note: suggested alternative:
#define myfinite std::isfinite
The Fix:
tc@box:~/src/ContextFree$ CPPFLAGS=-D_GLIBCXX_USE_C99_MATH=1 make
The Error:
tc@box:~/src/ContextFree$ make
[...]
g++ -Isrc-common -Isrc-unix -Iobjs -Isrc-common/agg-extras -Isrc-ffmpeg/include -I/usr/local/include -Isrc-agg -Isrc-agg/agg2 -O2 -Wall -Wextra -march=native -Wno-parentheses -std=c++14 -c -o objs/cfdg.tab.o objs/cfdg.tab.cpp
In file included from /tmp/tcloop/gcc/usr/local/include/c++/7.2.0/cmath:45:0,
from /tmp/tcloop/gcc/usr/local/include/c++/7.2.0/math.h:36,
from src-agg/agg2/agg_math.h:22,
from src-agg/agg2/agg_math_stroke.h:23,
from src-common/ast.h:32,
from src-common/astreplacement.h:29,
from src-common/cfdg.ypp:64:
src-common/bounds.h: In member function 'bool Bounds::valid() const':
src-common/bounds.h:41:23: error: '__builtin_isfinite' is not a member of 'std'
#define myfinite std::isfinite
^
src-common/bounds.h:59:37: note: in expansion of macro 'myfinite'
bool valid() const { return myfinite(mMin_X) && myfinite(mMax_X) &&
^~~~~~~~
src-common/bounds.h:41:23: note: suggested alternative:
#define myfinite std::isfinite