Closed cosoc closed 5 months ago
This not that easy. You need at least compile libudev statically. And solve some other problem
For linux/magic.h
you need linux-headers
For
linux/magic.h
you needlinux-headers
All necessary dependency packages have been installed
apt install libusb–dev libudev–dev linux-headers-$ (uname -r)
rusb = { version = "0.9.2"} Can smoothly compile
rusb = { version = "0.9.2",features = ["vendored"]} Header file not found
All problems lie in the use of musl. As I said earlier, building under musl is not such an easy task. You need to properly prepare the build environment. And standard packages will not suit you. You can find similar problem https://github.com/openssl/openssl/issues/7207 https://www.openwall.com/lists/musl/2017/11/23/1
Another option is to try to find a way to build libusb-1.0 under musl. I tried searching but didn't find any success story.
os info: debian11
Cargo.toml
test main function
build cmd
error
What am I going to do?
My Action Log
linux-vdso.so.1 (0x00007ffe463d8000) libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007fd2e1d9c000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd2e1d82000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd2e1d60000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd2e1d5a000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd2e1b86000) /lib64/ld-linux-x86-64.so.2 (0x00007fd2e1e4e000)
statically linked