title: unresolved std::__cxx11::basic_string::~basic_string and std::allocator<char>::~allocator() symbols
body: <p>I am trying to compile <a href="http://stefanfrings.de/qtwebapp/tutorial/index.html" rel="nofollow noreferrer">QtWebApp</a>  with Qt5.5.1 onto the latest RPI4-Raspbian Buster and I am encountering inexplicable GLIBCXX unresolved symbols</p>
  
  <p><strong>What Works</strong> : QtWebApp cross compiled from windows to armhf using qt5.5.1 binaries natively compiled on Raspbian Buster works fine with the following components </p>
  
  <ol>
  <li><p>Toolchain : <a href="http://sysprogs.com/getfile/566/raspberry-gcc8.3.0.exe" rel="nofollow noreferrer">raspberry-gcc8.3.0.exe</a> installed on Windows 10.</p></li>
  <li><p>Qt Binary Libs : Native compiled on RPI4 Raspbian Buster OS and
  copied over to Windows 10.</p></li>
  <li><p>Command line :
  <code>
  c:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -std=c++11 -fPIC -I. 
  {ALL QT INCLUDE DIRS}
  -IC:/SysGCC/raspberry/arm-linux-gnueabihf/sysroot/opt/vc/include 
  -g -rdynamic -funwind-tables -Woverflow
  {ALL QTWEB SOURCE FILES}
  -LC:/SysGCC/pi4/pi4qt551/lib 
  -lQt5Core -lQt5Gui -lQt5Widgets 
  -lQt5Multimedia -lQt5MultimediaWidgets 
  -lQt5Network -lm -lpthread -o qtweb
  </code></p></li>
  </ol>
  
  <p>This produces an arm executable that worksfine on RPI-4.</p>
  
  <p><strong>What fails</strong></p>
  
  <p>When compiling natively <em>(which is what I want as the development env)</em> on RPI4 the compilation strangely fails with the following error :</p>
  
  <p><code>/usr/bin/ld: /tmp/ccnnsRCD.o: undefined reference to symbol '_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev@@GLIBCXX_3.4.21'
  </code></p>
  
  <p><strong>What I have tried</strong> (didnt work)</p>
  
  <p><strong>1)</strong> Following suggestions from <a href="https://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring">Converting std::__cxx11::string to std::string</a> and passing <code>-D_GLIBCXX_USE_CXX11_ABI=0</code> it fails with the following error :</p>
  
  <p><code>/usr/bin/ld: /tmp/ccZfI5co.o: undefined reference to symbol '_ZNSaIcED1Ev@@GLIBCXX_3.4'</code></p>
  
  <p>where those symbol demangles to <code>std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::~basic_string()</code> and <code>std::allocator&lt;char&gt;::~allocator()</code> respectively.</p>
  
  <p><strong>2)</strong> I also ran all the combinations <code>WITH/WITHOUT -std=c++11 and D_GLIBCXX_USE_CXX11_ABI=0</code> and these are the errors </p>
  
  <pre><code>WITH  -std=c++11, WITHOUT -D_GLIBCXX_USE_CXX11_ABI=0 
  /usr/bin/ld: /tmp/ccnnsRCD.o: undefined reference to symbol '_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev@@GLIBCXX_3.4.21'
  
   WITH -std=c++11, WITH -D_GLIBCXX_USE_CXX11_ABI=0 
  /usr/bin/ld: /tmp/ccZfI5co.o: undefined reference to symbol '_ZNSaIcED1Ev@@GLIBCXX_3.4'
  
   WITHOUT -std=c++11, WITH -D_GLIBCXX_USE_CXX11_ABI=0 
  /usr/bin/ld: /tmp/cctFncwz.o: undefined reference to symbol '_ZNSaIcED1Ev@@GLIBCXX_3.4'
  
   WITHOUT -std=c++11, WITHOUT -D_GLIBCXX_USE_CXX11_ABI=0 
  /usr/bin/ld: /tmp/cchkJYdO.o: undefined reference to symbol '_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev@@GLIBCXX_3.4.21'
  </code></pre>
  
  <p><strong>3)</strong> I also copied the sysroot from the <a href="http://sysprogs.com/getfile/566/raspberry-gcc8.3.0.exe" rel="nofollow noreferrer">raspberry-gcc8.3.0.exe</a> install on Win10 over to RPi-4 and passed that to <code>gcc</code> as its <code>--sysroot</code> location - which also fails with the <code>~basic_string()</code> unresolver error. (I dont know how to verify if the <code>--sysroot</code> had any effect though I checked that <code>gcc -v</code> output doesnt have <code>--with_libs</code> in it as suggested in a <a href="https://stackoverflow.com/questions/17603213/cross-compilation-gcc-ignores-sysroot">GCC ignores --sysroot</a> post)</p>
  
  <p>INFO: The command line is exactly the same on the RPI4-Buster other than  using <code>gcc</code> and not passing <code>-IC:/SysGCC/raspberry/arm-linux-gnueabihf/sysroot/opt/vc/include</code> </p>
  
  <p><strong>Question :</strong>
  How is it that (assuming no glaring compile option mismatch ;) cross compiling with a gcc 8.3 toolchain from windows to arm-linux works but the same code base when compiled natively on raspbian buster with gcc 8.3 fails with what looks like GLIBCXX version mismatch in the Raspbian Buster OS binaries ?</p>
  
  <p>I am stuck on this for 2 days now. Please suggest any other steps I can try here.</p>