2

I have created .so library in my Ubuntu and run it on another machine. Got error:

/lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.15' not found

I suppose this is general C++ library. But how to solve such problem? I can't change client configuration and that means I must to do something with my configuration. But what exactly I must do?

UPD

ldd -version returns

my machine:

ldd (Ubuntu EGLIBC 2.19-0ubuntu6.6) 2.19

host machine:

ldd (Ubuntu EGLIBC 2.11.1-0ubuntu7.8) 2.11.1
vico
  • 17,051
  • 45
  • 159
  • 315

4 Answers4

2

On the target machine, run ldd --version and check the output which will tell you what version of GLIBC_ they have.

  1. You can then roll yours back to match their version.
  2. Statically link your executable so it doesn't need their Clib.
  3. You can also alter your program to use the older version, once you know what it is, that is.

See this SO solution for how to do that. How can I link to a specific glibc version?

Community
  • 1
  • 1
LawfulEvil
  • 2,267
  • 24
  • 46
  • I have updated my question body with ldd -version return. Strange that none of them have 2.15 version – vico Feb 01 '16 at 15:36
1

You have to make sure that you are linking to corresponding or older versions of GLIBC. GCC has flag --sysroot which allows you to define which libs are used.

This may help with details: https://sourceware.org/glibc/wiki/Testing/Builds

n0p
  • 713
  • 10
  • 23
0

The point is that creating a shared library necessarily means that you need to link it to the C library (glibc, in your case). That means that calls to C library functions (which the stdc++ library does) get replaced with actual correct symbol locations in the C library.

Now, if the C library on the compiling/linking machine is not the same as on the target machine, this must fail, and hence, libc version gets checked.

Solutions is to either statically link your .so (which honestly doesn't make much sense, usually), or just correctly compile and link it for your target machine.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • to link it to correct version of glibc I suppose I need to install it on my machine. But how how to do that? – vico Feb 01 '16 at 15:59
0

Beside compiling everything static, which is usually a bad idea or does not work at all, the only way to solve the isssue is to recompile your binary for the target platform.

Install a virtual machine or chroot with the same Ubuntu version as on the target platform and compile there. There are also solutions like sbuild or pbuilder/cowbuilder which automates this for Debian/Ubuntu packages.

jofel
  • 3,297
  • 17
  • 31