title: MinGW 4.8.1 C++11 thread support
body: <p>I downloaded the version of MinGW from the official website: <a href="http://sourceforge.net/projects/mingw/files/">http://sourceforge.net/projects/mingw/files/</a> and installed it on my Windows 7 machine.</p>
  
  <p>Running <code>g++ --version</code> gives me <code>g++.exe (GCC) 4.8.1</code> and I believe GCC 4.8.1 has support for C++11 features, including threads.</p>
  
  <p>Running <code>g++ -std=c++11 main.cpp</code> successfully compiles the following program.</p>
  
  <pre><code>//main.cpp
  #include &lt;memory&gt;
  
  int main() {
      std::unique_ptr&lt;int&gt; a(new int);
      return 0;
  }
  </code></pre>
  
  <p>But running <code>g++ -std=c++11 main.cpp</code> on the following program:</p>
  
  <pre><code>//main.cpp
  #include &lt;mutex&gt;
  
  int main() {
      std::mutex myMutex;
      return 0;
  }
  </code></pre>
  
  <p>gives errors:</p>
  
  <pre><code>main.cpp: In function `int main()`:
  main.cpp:5:5: error: 'mutex' is not a member of 'std'
      std::mutex myMutex;
      ^
  main.cpp:5:16: error: expected ';' before 'myMutex'
      std::mutex myMutex;
                  ^
  </code></pre>
  
  <p>as if <code>&lt;mutex&gt;</code> is not supported. The compiler does not complain about <code>#include &lt;mutex&gt;</code> so I have no idea why I'm getting this error.</p>