I'm trying to compile libtorrent on Alpine Linux.
autogen and configure work fine but after invoking make it fails with the following message:

local_addr.cc:45:10: fatal error: linux/netlink.h: No such file or directory

I looked in /usr/include and found only netlink/netlink.h. However the next include in the source file is rtnetlink.h which doesn't exist.
Is this due to a missing dependency or perhaps a problem related to glibc/musl? How do you build libtorrent/rtorrent under Alpine Linux?
I am aware there is an rtorrent package for Alpine but would rather prefer to build it myself, so I can customize the build options.

These are the packages I installed prior to my build attempt:

  • autoconf
  • automake
  • libtool
  • pkgconfig
  • ncurses-dev
  • zlib-dev
  • libsigc++-dev
  • libcurl
  • curl-dev
  • libnl-dev

It appears that the linux-headers package contains netlink.h, so install it:

apk add --update linux-headers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.