https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91876
--- Comment #2 from Young <lachiepoop at naver dot com> --- (In reply to Jonathan Wakely from comment #1) > The gdb backtrace shows your program is linked to the wrong libstdc++.so > that comes from the gcc-4.4.7 system compiler, not the one from gcc-7.2.1 > that you compiled with. > > See > https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths > and > https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared. > html#manual.intro.using.linkage.dynamic Thanks for your comment. Following is an update of me trying to match libstdc++ and gcc version, which ended up in smoke. My executable(a.out) seems to linked against /usr/lib64/libstdc++.so.6. Take a look at gdb log: #0 0x0000003603269ca2 in std::error_category::equivalent(std::error_code const&, int) const () from /usr/lib64/libstdc++.so.6 And I have double checked as well: $ ldd a.out linux-vdso.so.1 => (0x00007ffe32ff3000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003603200000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00000035fee00000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003600e00000) libc.so.6 => /lib64/libc.so.6 (0x00000035fea00000) /lib64/ld-linux-x86-64.so.2 (0x00000035fe200000) libm.so.6 => /lib64/libm.so.6 (0x00000035ffa00000) My libstdc++ (surprisingly) appears to be of gcc 4: $ ls -l /usr/lib64/libstdc++.so.6 lrwxrwxrwx. 1 root root 19 Feb 21 2017 /usr/lib64/libstdc++.so.6 -> libstdc++.so.6.0.13 According to this page(https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning.history), libstdc++.so.6.0.13 is of gcc 4.4.2, as Jonathan pointed out. I am on CentOS 6 and devtoolset-7. The devtoolset-7 actually provides libstdc++.so: $ ls -l /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++.so -rw-r--r-- 1 root root 210 Oct 25 2017 /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++.so $ cat /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++.so /* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) INPUT ( /usr/lib64/libstdc++.so.6 -lstdc++_nonshared ) And it is pointing back to /usr/lib64/libstdc++.so.6.0.13. For the moment, I can not lay my hands on libstdc++.so.6.0.24, which, according to the above page, is paired with gcc7. Thank you.