title: How to update g++ compiler on OSX
body: <p>I tried using <a href="https://arvindrao.wordpress.com/2012/12/31/installing-latest-gccg-via-homebrew/" rel="noreferrer">this</a> tutorial to download the newest version of g++, and I changed the version number from 4.7 to the newest (which is believe is) 8.1. But I get the following errors</p>
  
  <pre><code>Error: No available formula with the name "gcc81"
  ==&gt; Searching for a previously deleted formula (in the last month)...
  Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow
  
  Error: No previously deleted formula found.
  ==&gt; Searching for similarly named formulae...
  ==&gt; Searching local taps...
  Error: No similarly named formulae found.
  ==&gt; Searching taps...
  ==&gt; Searching taps on GitHub...
  Error: No formulae found in taps.
  </code></pre>
  
  <p>Does anyone know how to update my g++ version? This is what I get when I try to find out my current version.</p>
  
  <pre><code>g++ --version
  Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
  Apple LLVM version 9.1.0 (clang-902.0.39.1)
  Target: x86_64-apple-darwin17.5.0
  Thread model: posix
  InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  </code></pre>
  
  <p>Sorry Im such a noob, I really trying to learn here. </p>