title: How to compile the code using #include <thread>
body: <p>I am trying to compile some C++ code that uses threads:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;thread&gt;
  void hello()
  {
      std::cout&lt;&lt;"Hello Concurrent World\n";
  }
  
  int _main(int argc, _TCHAR* argv[])
  {
      std::thread t(hello);
      t.join();
      return 0;
  }
  </code></pre>
  
  <p>I get errors when compiling:</p>
  
  <pre><code>c:\temp\app1\app1\app1.cpp(6): fatal error C1083: Cannot open 
  include file: 'thread': No such file or directory
  
  
  ~/Documents/C++ $ g++ -o thread1 thread1.cpp -D_REENTRANT -lpthread
  In file included from /usr/include/c++/4.5/thread:35:0,
                   from thread1.cpp:2:
  /usr/include/c++/4.5/bits/c++0x_warning.h:31:2: error: #error This file 
  requires compiler and library support for the upcoming ISO C++ standard, 
  C++0x. This support is currently experimental, and must be enabled with 
  the -std=c++0x or -std=gnu++0x compiler options.
  </code></pre>
  
  <p>How do I fix these errors?</p>