繁体   English   中英

错误:无法为 libudev-sys v0.1.4 运行自定义构建命令

[英]error: failed to run custom build command for `libudev-sys v0.1.4`

我是 rust 的新手,正在尝试进行交叉编译。 但是,在这样做时我收到error: failed to run custom build command for 我尝试按照以下解决方案

https://github.com/dcuddeback/libudev-sys/issues/7

但是,我无法解决这个问题。 我正在使用 Ubuntu 20.04 并想为树莓派交叉编译。

如果有人可以让我了解我应该在构建脚本中包含什么,那就太好了。

#!/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

任何帮助将非常感激

只需安装在 package(此命令适用于 ubuntu)

 sudo apt-get install -y  libudev-dev

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM