title: How to configure libstdc++ with GCC 4.8?
body: <p>A while back, I decided to upgrade to GCC 4.8 in order to get an early start on some c++11 features. I got a bit sidetracked, though, and didn't really put any of the new features to use until a project a few days ago (the new compiler seemed to have been working fine, but it may just be because I wasn't utilizing any new functionality.) </p>
  
  <p>In this new project, when I compiled with the =std=c++11 flag, I had no problems. However, at runtime, I get the error: </p>
  
  <blockquote>
    <p><code>./main: /usr/lib/i386-linux-gnu/libstdc++.so.6: version</code>GLIBCXX_3.4.18' not found (required by ./main)`</p>
  </blockquote>
  
  <p>I assume that there is a problem linking to a more modern libstdc++ library associated with GCC 4.8, but I can't for the life of me figure out how to fix this or where the appropriate library should be. I remember symbolically linking the g++ and gcc binaries to gcc-4.8, which appears to be working, since <code>g++ -v</code> returns:</p>
  
  <blockquote>
    <p><code>Using built-in specs. 
    COLLECT_GCC=g++
    COLLECT_LTO_WRAPPER=/app/gcc/4.8.0/libexec/gcc/i686-pc-linux-gnu/4.8.0/lto-wrapper
    Target: i686-pc-linux-gnu
    Configured with: ./gcc-4.8.0/configure --prefix=/app/gcc/4.8.0
    Thread model: posix
    gcc version 4.8.0 (GCC)
    </code></p>
  </blockquote>
  
  <p>Another thread online led me to look at the <code>ldd</code> output for the program, which <em>did</em> show me that the directory structure for the libstdc++ libraries being linked to was different than the directory structure for the binaries. I couldn't, however, find the appropriate <code>libstdc++</code> libraries in the latter, so I'm not sure where to look. The output for <code>ldd main</code> is:</p>
  
  <blockquote>
    <p><code>./main: /usr/lib/i386-linux-gnu/libstdc++.so.6: version</code>GLIBCXX_3.4.18' not found (required by ./main)
        linux-gate.so.1 =>  (0xb7791000)
        libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb768e000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7662000)
        libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7644000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb749b000)
        /lib/ld-linux.so.2 (0xb7792000)`</p>
  </blockquote>
  
  <p>I'm not sure exactly where this is going wrong, and I'll continue Googling and looking around for answers, but any help you guys could offer would be greatly appreciated. If anything is unclear about the issue or I forgot some information, just let me know and I'll try to add that in. Thanks so much!</p>