4

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

asharkdoctor
  • 59
  • 1
  • 4

1 Answers1

1

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

https://stackoverflow.com/questions/4032373/linking-against-an-old-version-of-libc-to-provide-greater-application-coverage

https://stackoverflow.com/questions/32577224/unable-to-use-stdchrono-with-stdfuture-glibcxx-3-4-19-not-found?noredirect=1&lq=1