Score:1

Where is the static version of libudev?

cn flag

Because I want my binaries to run on older distributions, I decided to build a statically linked binary.

My application depends on libhid-hidraw and through that, on libudev.

I have the development packages installed:

sudo apt install libudev-dev libhidapi-dev

When I try to link, I get this error:

cc -g -Wall -Wextra -static daemon/turboledzd.c -o daemon/turboledzd -lhidapi-hidraw -ludev
/usr/bin/ld: cannot find -ludev
collect2: error: ld returned 1 exit status

On my system, there is a libhidapi-hidraw.a file present:

$ dpkg -S hidraw.a
libhidapi-dev:amd64: /usr/lib/x86_64-linux-gnu/libhidapi-hidraw.a

But no such static library for udev:

$ dpkg -S libudev.
libudev1:i386: /usr/lib/i386-linux-gnu/libudev.so.1
libudev-dev:amd64: /usr/lib/x86_64-linux-gnu/pkgconfig/libudev.pc
python3-pyudev: /usr/lib/python3/dist-packages/pyudev/_ctypeslib/libudev.py
libudev1:amd64: /usr/lib/x86_64-linux-gnu/libudev.so.1.7.1
libudev-dev:amd64: /usr/lib/x86_64-linux-gnu/libudev.so
libudev1:amd64: /usr/lib/x86_64-linux-gnu/libudev.so.1
libudev-dev:amd64: /usr/include/libudev.h
libudev1:i386: /usr/lib/i386-linux-gnu/libudev.so.1.7.1
libudev-dev:amd64: /usr/share/man/man3/libudev.3.gz

Which Ubuntu package will contain the libudev.a library?

Score:1
ng flag

Well, it is not available upstream and at Debian either.

Here is a related bug report #915566 in Debian and they end up not implementing solution due to the large resulting static files and no demand from users.

It is part of systemd, you will able to compile it using these flags: -Dstatic-libsystemd=true -Dstatic-libudev=true . See referenced bug report.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.