4

I'm building a program in a VM then deploying to another machine. This has been working for some time.

Today I've started receiving this error message when I attempt to execute my program:

/usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.19' not found

Both machines are running the same kernel version, and all packages are up to date:

$ uname -a
Linux darwin7 3.8.0-23-generic #34-Ubuntu SMP Wed May 29 20:24:54 UTC 2013 i686 i686 i686 GNU/Linux

How might I investigate and repair this issue?

Drew Noakes
  • 5,708
  • How is this a duplicate of a question that was asked after it? Surely the other should be closed as a duplicate of this... – Drew Noakes Jul 20 '17 at 10:01
  • 1
    Age has never been a particularly important factor in deciding dupes. Visibility, quality of posts, etc. are. The other post has been viewed 6 times as often as this one in far less time. – muru Jul 20 '17 at 10:24
  • @muru fair enough. Makes sense. – Drew Noakes Jul 20 '17 at 15:24

2 Answers2

5

More lightweight solution is to install just libstdc++ from nondefault repository:

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install libstdc++6-4.7-dev
luart
  • 960
  • I had the same issue recently (GLIBCXX_3.4.20 missing), but for me installing libstdc++6-4.7-dev was not enough, I also had to install the package libstdc++6 (I don't know if it would work without installing libstdc++6-4.7-dev beforehand). – iled Jan 18 '16 at 09:44
3

In the end I realised I had different versions of gcc (g++) installed on the two machines. I was building with 4.8 and running where only 4.7 was available. Installing 4.8 on the target machine (as described here) solved the problem.

There may be a more lightweight solution that doesn't involve installing the full compiler but rather just the required library.

Drew Noakes
  • 5,708
  • Yes, In my case this is also the correct answer. I am running an HPC environment with several nodes. If you are in the same situation you can test the problem with this command: for n in YOUR_NODE_NAME_ROOT_HERE{01..08}; do ssh $n "hostname; strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX"; done – user9869932 Oct 05 '15 at 19:41