btleplug
btleplug copied to clipboard
compilation error when compiling to arm
Describe the bug
i get a pkg config error when i try to compile my code to armv7-unknown-linux-gnueabihf
Expected behavior the code should compile without an errors
Actual behavior
when i compile my code for armv7-unknown-linux-gnueabihf
, get this error: pkg_config failed: pkg-config has not been configured to support cross-compilation.
.
Additional context I am compiling from x86 linux
Have you set up pkg-config
for cross compilation? You'll need libdbus
to link against, at least. cross is one way to do this, you'll want something like this Dockerfile.
I was able to set up pkg-config for cross compilation, but now i get this linker error: /usr/lib/gcc-cross/arm-linux-gnueabihf/11/../../../../arm-linux-gnueabihf/bin/ld: cannot find -ldbus-1: No such file or directory collect2: error: ld returned 1 exit status
btleplug
on Linux depends on libdbus
, so you'll need to have it available to link against for your target architecture. How to do that depends on what distribution you are using. Using cross
and a Docker container as I suggested above will make this simpler.
now I get this error when compiling with cross The system library
dbus-1required by crate
libdbus-sys was not found.
Did you install libdbus-1-dev in the Docker container for cross, using the Dockerfile I linked or otherwise?