3

I'm developing an app on Ubuntu 16.04. When I'm trying to deploy it on my Centos 7.3 servers, I'm receiving the following error:

/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found

I tried to do as mentioned at this answer but I'm still receiving the same error.

In order to compile my app, I compiled gcc 5.4.0 from source.

When I'm trying to update libstdc++ by yum install libstdc++.x86_64 it says that Package libstdc++-4.8.5-11.el7.x86_64 already installed and latest version

Community
  • 1
  • 1
liorko
  • 1,435
  • 2
  • 24
  • 41

1 Answers1

2

If you're deploying on CentOS 7, build on CentOS 7.

Otherwise your runtime dependencies won't match up.

It's possible to ship your Ubuntu's libc and libstdc++ with your application, but you should avoid having to do this, if possible.

Community
  • 1
  • 1
Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
  • I forgot to mention it, I'm compiling the source code again on my server. – liorko Dec 19 '16 at 12:41
  • Where does Ubuntu come into it then? – Lightness Races in Orbit Dec 19 '16 at 12:41
  • The development was done in Ubuntu. After the development done, we build it on CentOS servers. – liorko Dec 19 '16 at 12:45
  • Then for the purpose of this question, the development was done on CentOS. It doesn't matter whether your programming/text editor lives on Ubuntu, Windows, Mac or a paper notepad. To me it sounds like your problem is building GCC from source, rather than using the package manager to install whatever comes with CentOS 7.3, and then not installing it properly. Why don't you use CentOS 7's built-in compiler? Then when you have built your application, its dependencies will match whatever comes with CentOS 7. Otherwise you're going to have to manually install the different libs. – Lightness Races in Orbit Dec 19 '16 at 12:45
  • When I tried to use the built-in compiler, I got plenty of errors that says that the version of my gcc is too old. – liorko Dec 19 '16 at 12:50
  • Are you writing C++14 or something? What new features do you need? Try to avoid that - going off-piste with compilers is not pleasant. (I've done it recently because I needed C++11 on CentOS 6 — you have to bundle the runtimes and play around with linker settings — although you may be able to statically link instead, depending on your requirements, which you haven't stated) – Lightness Races in Orbit Dec 19 '16 at 12:53
  • Well, CentOS 7 comes with GCC 4.8, which supports [most of] C++11. Specifically what was the problem you were having with the built-in compiler? You might be better off trying to resolve _that_. – Lightness Races in Orbit Dec 19 '16 at 13:07