two versions of gcc on Mac Sierra and build fails
<p>I keep failing to build a project with error
    configure: error: C preprocessor "/lib/cpp" fails sanity check</p>

<p>I checked and found two versions of gcc on my Mac Sierra
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc and
/Library/Developer/CommandLineTools/usr/bin/gcc
both gives version  x86_64-apple-darwin16.0.0</p>

<p>then on default path /usr/local/bin/gcc, it is version
x86_64-apple-darwin14.0.0</p>

<p>I suspect the default version is the wrong one which causes the build to fail, but brew upgrade gcc does not fix it. I tried brew unlink gcc, did not remove 
/usr/local/bin/gcc, and it is still the default gcc</p>

<p>How to remove the x86_64-apple-darwin14.0.0 version, and force the system to use the x86_64-apple-darwin16.0.0 version?</p>