I keep failing to build a project with error configure: error: C preprocessor "/lib/cpp" fails sanity check
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
then on default path /usr/local/bin/gcc, it is version x86_64-apple-darwin14.0.0
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
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?
brew unlink gcc
really doesn't work (it should - try it again), then trybrew uninstall gcc
. – Paul R Oct 10 '16 at 6:21