title: Error when compiling gcc 4.6.1 C++0x threading code on MacOSX Lion
body: <p>When compiling the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;thread&gt;
  
  using namespace std;
  
  void hello()
  {
          cout &lt;&lt; "Hello World!" &lt;&lt; endl;
  }
  
  int main()
  {
          cout &lt;&lt; "starting" &lt;&lt; endl;
          thread t(hello);
          t.join();
          cout &lt;&lt; "ending" &lt;&lt; endl;
          return 0;
  }
  </code></pre>
  
  <p>using: </p>
  
  <pre><code>$ g++-4.6.1 -std=c++0x -pthread threading.cpp
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>threading.cc: In function ‘int main()’:
  threading.cc:13:2: error: ‘thread’ was not declared in this scope
  threading.cc:13:9: error: expected ‘;’ before ‘t’
  threading.cc:14:2: error: ‘t’ was not declared in this scope
  </code></pre>
  
  <p>This is on MacOSX Lion with a custom built gcc 4.6.1. All the other c++0x features that are valid for gcc 4.6 works like a charm. Is this a MacOSX specific error?</p>