Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross and hidapi #121

Open
axoulc opened this issue Jun 27, 2023 · 0 comments
Open

Cross and hidapi #121

axoulc opened this issue Jun 27, 2023 · 0 comments

Comments

@axoulc
Copy link

axoulc commented Jun 27, 2023

Hi everyone, I need your help. I need to compile my project for raspberry zero w (arm-unknown-linux-gnueabihf) with cross-rs.

One of my dependencies is hidapi.

And I can't compile it because of this error :

running: "arm-unknown-linux-gnueabihf-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-march=armv6" "-marm" "-mfpu=vfp" "-I" "etc/hidapi/hidapi" "-Wall" "-Wextra" "-o" "/target/arm-unknown-linux-gnueabihf/debug/build/hidapi-1db7329408b595f5/out/etc/hidapi/linux/hid.o" "-c" "etc/hidapi/linux/hid.c"
  cargo:warning=etc/hidapi/linux/hid.c:43:10: fatal error: libudev.h: No such file or directory
  cargo:warning= #include \<libudev.h>
  cargo:warning=          ^~~~~~~~~~~
  cargo:warning=compilation terminated.
  exit status: 1

  --- stderr

I even tried to build it with a custom Dockerfile, but with the same issue.

My Cross.toml :

[target.arm-unknown-linux-gnueabihf]
pre-build = [
    "dpkg --add-architecture $CROSS_DEB_ARCH",
    "apt-get update && apt-get install --assume-yes libusb-1.0-0-dev:amd64 libudev-dev:amd64 libhidapi-dev:amd64 libusb-1.0-0-dev:$CROSS_DEB_ARCH libudev-dev:$CROSS_DEB_ARCH libhidapi-dev:$CROSS_DEB_ARCH"
]

Thanks in advance if anyone could help me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant