title: libstdc++ Error: 'GLIBCXX_3.4.22' not found
body: <p>I was trying to cross-compile dlib for Raspberry Pi, using the arm-linux-gnueabihf compiler.</p>
  
  <p>After successful runs of <code>cmake</code> and <code>make -j4</code>, I ran <code>python setup.py bdist_wheel --repackage</code>, which created the necessary .so files which I later copied to my Pi's <code>/usr/lib</code> using <code>scp</code>.</p>
  
  <p>Now when I run <code>import dlib</code> in IDLE, I get the following error:</p>
  
  <p><code>ImportError: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by dlib/dlib.so)
  </code></p>
  
  <p>Here's the ouput of <code>strings /usr/lib/libstdc++.so.6 | grep GLIBCXX</code>:</p>
  
  <p><code>GLIBCXX_3.4
  GLIBCXX_3.4.1
  GLIBCXX_3.4.2
  GLIBCXX_3.4.3
  GLIBCXX_3.4.4
  GLIBCXX_3.4.5
  GLIBCXX_3.4.6
  GLIBCXX_3.4.7
  GLIBCXX_3.4.8
  GLIBCXX_3.4.9
  GLIBCXX_3.4.10
  GLIBCXX_3.4.11
  GLIBCXX_3.4.12
  GLIBCXX_3.4.13
  GLIBCXX_3.4.14
  GLIBCXX_3.4.15
  GLIBCXX_3.4.16
  GLIBCXX_3.4.17
  GLIBCXX_3.4.18
  GLIBCXX_3.4.19
  GLIBCXX_3.4.20
  </code></p>
  
  <p>This means that the error is legitimate, but my libstdc++ is already at its newest version on the Pi. What can I do to get that <strong>3.4.22</strong> version installed on the Pi? Or maybe, if it's possible, to compile it again against <strong>3.4.20</strong>? How can I set a compiler flag for that?</p>
  
  <p><em>Note:</em> I posted this on the RaspberryPi SE site, but was suggested to ask it here. <a href="https://raspberrypi.stackexchange.com/questions/72177/libstdc-error-glibcxx-3-4-22-not-found?noredirect=1#comment113566_72177">libstdc++ Error</a></p>