0

I'm trying to deploy my application as a stand-alone that can work on any Linux machine. I've built my application under Qt Creator and have successfully statically linked my application. However, when I test the application on another Linux machine, I get the following error:

libstdc++.so.6: version 'GLIBCXX_3.4.21' not found (required by ./Executable)

I'm not sure how to resolve this error.

xcyl40
  • 43
  • 1
  • 9

1 Answers1

0

This is a error i had myself, but in another context. What this means is: libstdc++.so.6 (a shared object file, the standard library of c++ programms, that many programms can use together(share)) is another version then the program you compiled requires.

i had this issue when switching from gcc-4.8 to gcc-5.

Have you using different linux distros when compiling and executing? (Ubuntu?)

You must make sure the versions match, or statically compile the used libstdc++ into your binary as well.

Here is a SO question relating to these kind of issues. GLIBCXX versions

jonas_toth
  • 872
  • 5
  • 8
  • Compile statically as already suggested. And please edit your post to include name and version of the target OS´s you want to run your software. It's possible to use a copy of libstdc++.so.6.0.21, and then point to that with a start script. **But** : The libstdc++.so.6.0.21 must be compiled for the older OS. So far a version for EL7, Fedora ~19 is available https://drive.google.com/file/d/0B7S255p3kFXNNTIzU2thRlZmYVE/view?usp=sharing – Knud Larsen Jul 18 '16 at 22:06
  • Could you tell me how to statically compile the libstdc++ library into my binary executable? – xcyl40 Jul 18 '16 at 22:19
  • First : Please check your program with `ldd` on all the target OS´s : `ldd [executables]` ( and `ldd [libraries]` , if any.) I.e. libstdc++.so.6.0.21 may not be the only requirement. – Knud Larsen Jul 19 '16 at 13:31
  • i didnt do it my self, but these sources seem as a starting point: http://www.trilithium.com/johan/2005/06/static-libstdc/ https://stackoverflow.com/questions/13636513/linking-libstdc-statically-any-gotchas – jonas_toth Jul 19 '16 at 21:29