title: C++ std library linking with different C++ standards
body: <p>I am compiling a project using Cygwin (GCC v4.5.0) and I'm having an odd linker problem. I am hoping somebody with some expertise can help.</p>
  
  <blockquote>
    <p>Error: undefined reference to <code>std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;&amp;)</code></p>
  </blockquote>
  
  <p>However, the linking only fails when I compile with the gcc compiler flag:
  <code>-std=c++0x</code>
  It succeeds when I don't specify the standard.</p>
  
  <p>Some notes:</p>
  
  <ol>
  <li>I am informing gcc to link the standard library manually with the compiler flag: <code>-lstdc++</code></li>
  <li>The symbol dependency is originating from a Boost library header file (v.1.45.0):
  <code>boost::units::detail::utility.hpp, function: std::string demangle(const char* name);</code></li>
  <li>The application compiles and links properly using MinGW gcc v4.5.0.</li>
  </ol>
  
  <p>Questions:</p>
  
  <ol>
  <li>Does the compiled standard library usually contain different symbols for different C++ standards?</li>
  <li>Does the name mangling of symbols change with different C++ standards in GCC?</li>
  <li>Why can't the linker find the symbols for <code>std::basic_string</code> when I can guarantee that it can find <code>libstdc++.a</code>?</li>
  </ol>
  
  <p>Thanks in advance everyone.</p>
  
  <p>-JT </p>