1

Hi. I am using a machine remotely which has an g++ version too old to compile a c++ program. I installed gcc-5.4.0 using http://luiarthur.github.io/gccinstall. The code complies but when running it I get the following error:

./run_with_config: /usr/lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by ./run_with_config) ./run_with_config: /usr/lib64/libstdc++.so.6: versionCXXABI_1.3.9' not found (required by ./run_with_config) ./run_with_config: /usr/lib64/libstdc++.so.6: version GLIBCXX_3.4.18' not found (required by ./run_with_config) ./run_with_config: /usr/lib64/libstdc++.so.6: versionCXXABI_1.3.5' not found (required by ./run_with_config) ./run_with_config: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./run_with_config)

So the path that is searched

/usr/lib64/

is the incorrect one. I am not sure what I would have to adjust so that the correct path is the one searched.

Help would be appreciated.

Anton Malyshev
  • 8,686
  • 2
  • 27
  • 45
user110503
  • 115
  • 4

1 Answers1

2

Compile with -static-libstdc++ flag (probably you'll need -static-libgcc as well) - that will include newer runtime library inside binary, so outdated /usr/lib64/libstdc++.so.6 library would not be used.

Anton Malyshev
  • 8,686
  • 2
  • 27
  • 45