Reputation: 43
I am working on a project which needs to be executed in a Linux machine that has turned out not to have the GLIBCXX_3.4.20
version of a library, but the code needs it. Is there anyway to find which part of my code (C++) asks for this version?
I read the ELF file using objdump
and realdef
and I found which symbol needs it:
_ZSt24__throw_out_of_rang@GLIBCXX_3.4.20 (4)
but I don't know to which part of my code can be related.
Upvotes: 0
Views: 351
Reputation: 213556
Your question is essentially a duplicate of this question.
Except in your case, it's not libc.so.6
, but libstdc++.so
that's giving you trouble.
Your problem is that you are compiling with new GCC, but are running on a machine with an old libstdc++.so
.
You have a few options:
libstdc++.so
-static-libstdc++
flag to link required version of libstdc++
directly into your application. This will make a larger binary, but it will not be using libstdc++.so
at all.libstdc++.so
, your binary may not run correctly on the target machine, so this solution should be used with caution.Upvotes: 1