title: cc1plus: error: unrecognized command line option ‘-std=c++11’ Ubuntu gcc 4.7
body: <p>I am trying to compile some c++11 code on ubuntu 12.04. After invoking my makefile I got</p>
  
  <blockquote>
    <p>cc1plus: error: unrecognized command line option ‘-std=c++11’</p>
  </blockquote>
  
  <p>Ubuntu gcc 4.7. Fine, so I ran </p>
  
  <pre><code>sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  sudo apt-get update
  sudo apt-get install gcc-4.7
  </code></pre>
  
  <p>Ran it again, and still the same problem. Great.So then I tried changing the symlink of gcc from gcc4.6 to 4.7. After doing this, it then went and complained about not being able to find g++. So I then ran</p>
  
  <pre><code>sudo apt-get update    
  sudo apt-get install build-essential
  </code></pre>
  
  <p>Still no luck. When I typed g++, I just got </p>
  
  <blockquote>
    <p>The program 'g++' can be found in the following packages:<br>
         *g++<br>
         *pentium_builder<br>
        Try: sudo apt-get install &lt;selected package>  </p>
  </blockquote>
  
  <p>So I then tried </p>
  
  <pre><code>sudo apt-get install pentium_builder
  </code></pre>
  
  <p>Now I get </p>
  
  <blockquote>
    <p>Unable to exec g++.real: No such file or directory</p>
  </blockquote>
  
  <p>How I can compile c++11 code?</p>