title: Cannot use C libraries that include math.h with g++ 7 (Raspberry PI)
body: <p>I've built GCC 7.2.0 for Raspberry PI, and installed it with prefix <code>/usr/local/gcc-7.2.0</code> (using <a href="https://www.solarianprogrammer.com/2017/12/07/raspberry-pi-raspbian-compiling-gcc/" rel="nofollow noreferrer">this tutorial</a>). Whenever I try to compile a source that includes a C library that in turn includes <code>math.h</code> I get strange errors. Below is a minimal example:</p>
  
  <pre><code>extern "C" {
  #include &lt;libavcodec/avcodec.h&gt;
  }
  
  int main() {
      return 0;
  }
  </code></pre>
  
  <p><strong>Note:</strong> <code>extern "C"</code> is necessary here because <code>avcodec.h</code> doesn't have it. I'm sure it is not the problem, as I've tried removing it and still get the same error.</p>
  
  <p>Compiling with <code>/usr/local/gcc-7.2.0/bin/g++-7.2.0 main.cpp</code>, I get the following error:</p>
  
  <pre><code>In file included from /usr/local/include/libavutil/common.h:36:0,
                   from /usr/local/include/libavutil/avutil.h:296,
                   from /usr/local/include/libavutil/samplefmt.h:24,
                   from /usr/local/include/libavcodec/avcodec.h:31,
                   from main.cpp:4:
  /usr/local/gcc-7.2.0/include/c++/7.2.0/math.h:65:12: error: ‘constexpr bool std::isinf(double)’ conflicts with a previous declaration
   using std::isinf;
              ^~~~~
  In file included from /usr/include/features.h:374:0,
                   from /usr/include/errno.h:28,
                   from /usr/local/include/libavcodec/avcodec.h:30,
                   from main.cpp:4:
  /usr/include/arm-linux-gnueabihf/bits/mathcalls.h:201:1: note: previous declaration ‘int isinf(double)’
   __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
   ^
  In file included from /usr/local/include/libavutil/common.h:36:0,
                   from /usr/local/include/libavutil/avutil.h:296,
                   from /usr/local/include/libavutil/samplefmt.h:24,
                   from /usr/local/include/libavcodec/avcodec.h:31,
                   from main.cpp:4:
  /usr/local/gcc-7.2.0/include/c++/7.2.0/math.h:66:12: error: ‘constexpr bool std::isnan(double)’ conflicts with a previous declaration
   using std::isnan;
              ^~~~~
  In file included from /usr/include/features.h:374:0,
                   from /usr/include/errno.h:28,
                   from /usr/local/include/libavcodec/avcodec.h:30,
                   from main.cpp:4:
  /usr/include/arm-linux-gnueabihf/bits/mathcalls.h:234:1: note: previous declaration ‘int isnan(double)’
   __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
   ^
  </code></pre>