Getting rid of the error version GLIBC_2.40 not found

When i compile an app written in C and copy it to another system, it is usual that i have an error like this one :

“Error /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.40’ not found”.

On my main system (Archlinux) i have the gnu libc version 2.40 and on my second system i have 2.36 (Debian).

To get rid of that error there are two options that i use:

  1. Static binding, the output file will not require any library but it will be bigger
gcc <myfile.c> -o <myfile> -static
  1. Using the shared option
gcc <myfile.c> -o <myfile> -shared

MG1

C

95 Words

2025-01-24 09:56 +0100

.