When trying to execute any c++ programs, I get this error. The full error message is:

./main: relocation error: ./main: symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

in my /usr/local/lib64 folder they all seem to be there:

libssp.so.0.0.0 libstdc++.a libstdc++fs.a libstdc++fs.la libstdc++.la libstdc++.so libstdc++.so.6 libstdc++.so.6.0.21 libstdc++.so.6.0.21-gdb.py libsupc++.a libsupc++.la

in my ./include folder, all the C++stdlib headers are there, and they seem to be working as I will get errors from them if I have syntax errors or something, hell, the files even compile fine but i get this error at runtime. I have not yet tried simply reinstalling all the libraries, as i'm not totally sure if that is necessary. Can someone help explain this error to me?

I have tried various fixes suggested on GLIB_3.4.15 error pages on this site, although either I followed those instructions incorrectly or they did not work for me.

I am running Ubuntu 14.04 LTS, and my GCC version is 5.3.0


This is because it's looking for a symbol from GLIBCXX_3.4.21, while you presumably have a lower version. Update your library, it's the easiest way. Or you can do something like what's done here



Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.