[英]error: failed to run custom build command for `libudev-sys v0.1.4`
I am new to rust and trying to do cross compilation.我是 rust 的新手,正在尝试进行交叉编译。 However while doing that I am getting an error error: failed to run custom build command for
libudev-sys v0.1.4.但是,在这样做时我收到error: failed to run custom build command for
。 I tried following the solution at我尝试按照以下解决方案
https://github.com/dcuddeback/libudev-sys/issues/7 https://github.com/dcuddeback/libudev-sys/issues/7
However, I was not able to resolve the issue.但是,我无法解决这个问题。 I am using Ubuntu 20.04 and want to cross compile for raspberry pi.我正在使用 Ubuntu 20.04 并想为树莓派交叉编译。
It would be great if someone can provide me an insight to what should I include in the build script.如果有人可以让我了解我应该在构建脚本中包含什么,那就太好了。
#!/bin/sh
SYSROOT=/build/root
export PKG_CONFIG_DIR=
export PKG_CONFIG_LIBDIR=${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig
export PKG_CONFIG_SYSROOT_DIR=${SYSROOT}
export PKG_CONFIG_ALLOW_CROSS=1
# tell pkg-config where to find libudev.pc
export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
# tell cargo to link with an armhf compatible linker
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
cargo build --release --target=armv7-unknown-linux-gnueabihf
Any help would be much appreciated任何帮助将非常感激
just install in the package (this command is for ubuntu)只需安装在 package(此命令适用于 ubuntu)
sudo apt-get install -y libudev-dev
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.