Create statically-linked binary that uses getaddrinfo?

前端 未结 3 1773
忘掉有多难
忘掉有多难 2020-11-30 00:50

I have included the header netdb.h, where getaddrinfo is included, but gcc issues this warning:

warning: Using \'getaddrinfo\' in s         


        
3条回答
  •  情深已故
    2020-11-30 01:09

    I found a solution: you can use musl library to replace glibc. To use musl, you can either install it and build your software using musl-gcc, or you can use a Linux distribution that uses musl, e.g. Alpine Linux.

    In my case, to save time, I chose Alpine Linux to build my program (https://github.com/zhanxw/rvtests), as I don't want to build multiple compilers (gcc, g++ and gfortran).

提交回复
热议问题