Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix a "version `GLIBC_2.14' not found" error?

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

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

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

Other than upgrading my machine to Ubuntu 12.4, the only significant change we've brought to the code is a call to strdup(), for which I had to enable the _POSIX_C_SOURCE=200809L feature test macro.

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

How do I fix this problem?

like image 756
lindelof Avatar asked Feb 21 '23 07:02

lindelof


1 Answers

I think the critical bit of info here is 'upgrading my machine'. So when this worked before, you were building and packaging on something earlier than 12.04? If so, then the issue is that 12.04 now ships with a newer version of libc (apparently 2.14), and your binary now records a dependency on that version of libc. When you try to run on Lenny, which likely uses an older version of libc, the linker detects that the Lenny version does not support the 2.14 API, and fails.

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 Debian release, use pbuilder or similar to create debs. This will ensure that the libraries used for the packaging build match the target platform.

like image 132
acm Avatar answered Feb 23 '23 07:02

acm