title: Writing string to ostream
body: <p>When I try to compile the code below (in a Qt 4.8 using llvm-g++-4.2 (GCC) 4.2.1), I get the following error:</p>
  
  <pre><code>../GLWidget.cpp:24:   instantiated from here
  ../GLWidget.cpp:24: error: explicit instantiation of 'std::basic_ostream&lt;_CharT, _Traits&gt;&amp; std::operator&lt;&lt;(std::basic_ostream&lt;_CharT, _Traits&gt;&amp;, const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, _Alloc = std::allocator&lt;char&gt;]' but no definition available 
  </code></pre>
  
  <p>What does this error mean, and what should I do to fix it?</p>
  
  <p>Source code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  void testOStream(){
      filebuf fb;
      fb.open ("test.txt",ios::out);
      std::ostream os(&amp;fb);
      std::string test("test");
      os &lt;&lt; test; // This line has the problem
      fb.close();
  }
  </code></pre>