title: gcc static libstdc++ for redistributing a library
body: <p>I've run into a problem using OpenNao from Aldebaran's Gentoo (2.1.2.17) version.
  It uses gcc-4.5.3 and refuses to upgrade to a newer GCC version via <em>emerge</em>.
  However, both ROS and our framework relies on C++11, and has features which C++0x doesn't cover.</p>
  
  <p>I've downloaded, built and installed in a home directory, gcc-4.8.4 successfully, and built our library, however, when I don't statically link with libstdc++, I get the usual error:</p>
  
  <pre><code>libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by...)
  </code></pre>
  
  <p>When I use the g++ flag: <strong>-static-libstdc++</strong> I can verify via <em>readelf -d</em> that the binary which uses our library, does not any longer require libstdc++.so.6 which I have statically linked within our library.</p>
  
  <p>Is this standard/defined behaviour? 
  Is this in fact, the best way to freeze our library (which in turn is built both as static and shared) to gcc-4.8.4, until Aldebaran decides that it will support C++11?</p>
  
  <p>[EDIT]</p>
  
  <p>The shared library built, reads:</p>
  
  <pre><code>Dynamic section at offset 0x224bf8 contains 27 entries:
    Tag        Type                         Name/Value
   0x00000001 (NEEDED)                     Shared library: [libboost_system.so.1.55.0]
   0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
   0x00000001 (NEEDED)                     Shared library: [libm.so.6]
   0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
   0x00000001 (NEEDED)                     Shared library: [libc.so.6]
   0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
   0x0000000e (SONAME)                     Library soname: [librapp.0.1.so]
  </code></pre>
  
  <p>Whereas the static-libstdc++ shared library reads:</p>
  
  <pre><code>Dynamic section at offset 0x2eb790 contains 26 entries:
    Tag        Type                         Name/Value
   0x00000001 (NEEDED)                     Shared library: [libboost_system.so.1.55.0]
   0x00000001 (NEEDED)                     Shared library: [libm.so.6]
   0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
   0x00000001 (NEEDED)                     Shared library: [libc.so.6]
   0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
   0x0000000e (SONAME)                     Library soname: [librapp.0.1.so]
  </code></pre>
  
  <p>So, to me, the problem linked with GLIBCXX_3.4.15 not being found, is related to libstdc++.so.6 which I am guessing ships with gcc-4.8.4 and has a different version/ABI from whatever libstdc++ came with OpenNao/gcc-4.5.3
  In fact, the errors when linking a binary with our library, had to do with std::placeholders.</p>