title: How do I enable C++11 in gcc?
body: <p>I use gcc 4.8.1 from <a href="http://hpc.sourceforge.net">http://hpc.sourceforge.net</a> on Mac OSX Mountain Lion. I am trying to compile a C++ program which uses the <code>to_string</code> function in <code>&lt;string&gt;</code>. I need to use the flag <code>-std=c++11</code> every time:</p>
  
  <pre><code>g++ -std=c++11 -o testcode1 code1.cpp
  </code></pre>
  
  <p>Is there a way to include this flag by default?</p>