How to fix the error "version" GLIBC_2.14 "not found"?

I compiled a C program under Ubuntu 12.04, put the Debian package out of it, and I want to install it on a server running Debian Lenny.

The last time I did this (about two months ago), it worked: I could install the package and run the binary. But now I get the following error message:

(binary name): /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by (binary name)) 

Besides upgrading my machine to Ubuntu 12.4, the only significant change we made to the code was the strdup() call, for which I had to enable the function check macro _POSIX_C_SOURCE=200809L .

Upgrading a server to the latest version of Debian is not my preferred option since it is not under my direct control.

How to fix this problem?

+4
source share
1 answer

I think the critical bit of information here is "upgrading my car." So when it worked before, did you build and pack something before 12.04? If so, then the problem is that 12.04 now comes with a newer version of libc (apparently 2.14), and now your binary writes a dependency on this version of libc. When you try to run Lenny, which is probably using an older version of libc, the linker detects that the Lenny version does not support API 2.14 and does not work.

I think the best way forward is probably to do your development and testing on 12.04, and then when you want to create packages for a specific version of Debian, use pbuilder or similar to create deb. This ensures that the libraries used to build the packaging are consistent with the target platform.

+8
source

Source: https://habr.com/ru/post/1415322/


All Articles