how do I remove `GLIBC_2.27' requirement at compile time?

前端 未结 3 851
感情败类
感情败类 2021-01-19 07:34

I\'ve been using a docker image for c++ compilation. It\'s based on Ubuntu 18.04. When I attempt to run on some Ubuntu 16 systems, I get this message:

/lib/x86_64-li

3条回答
  •  星月不相逢
    2021-01-19 08:01

    I faced the same problem.

    /lib/i386-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by your_lib.so) 
    

    After searching over the internet, I found some links that could be useful.

    Static link: Link with -static. See How can I link to a specific glibc version?

    Using docker: See Can docker solve a problem of mismatched C shared libraries?

    Proprietary solution: See https://github.com/wheybags/glibc_version_header

    I have decided to follow the first one. So I created a static library for your_lib.so and linked it statically with my binary.

提交回复
热议问题