1

I have a program that I compile using CMake on machine A but I want to run it on an older machine B. When I do so I get the following:

/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./program)
/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./program)
/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./program)

I have seen this question and I think the best way to resolve my problem would be to copy the newer version to machine B. So I copied /usr/lib/libstdc++.so.6 (and libstdc++.so.6.0.14) from A to ~/lib on B and did

export LD_LIBRARY_PATH=~/lib:$LD_LIBRARY_PATH

afterwards. When starting my program I now get

Floating point exception

What can I do to make it work?

Community
  • 1
  • 1
boothby81
  • 265
  • 3
  • 6
  • I know this sucks and is not what you want to hear, but if you need to run code on older glibc/libstdc++, compile the code on a system with the oldest version you need. Old libraries and new compiles are just not compatible, and replacing or superceding libc/libstdc++ on Linux mostly stabs you in the back when you least expect it. – rubenvb Oct 17 '12 at 15:28

1 Answers1

0

As you discovered, you need to have the newer libstdc++.so.6 present on the older system, and tell the dynamic linker how to find it.

See How do I insure that the dynamically linked library will be found? in the libstdc++ FAQ and Finding Dynamic or Shared Libraries in the manual for details of how to make sure it's found, with several options. LD_LIBRARY_PATH is just one of the options.

The floating point exception shouldn't be related to libstdc++, you'll need to use a debugger to find where that comes from and get more details.

Jonathan Wakely
  • 166,810
  • 27
  • 341
  • 521