简体   繁体   English

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

[英]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.

相关问题 错误:无法为 `gmp-mpfr-sys v1.4.0` 运行自定义构建命令 - Error: Failed to run custom build command for `gmp-mpfr-sys v1.4.0` 错误:无法使用 Rust/Anchor 为 `openssl-sys v0.9.72` 运行自定义构建命令 - error: failed to run custom build command for `openssl-sys v0.9.72` using Rust/Anchor 一些错误无法为 `librocksdb-sys v6.11.4` 运行自定义构建命令 - some error failed to run custom build command for `librocksdb-sys v6.11.4` ` 错误:无法为 `openssl-sys v0.9.67` 运行自定义构建命令 - ` error: failed to run custom build command for `openssl-sys v0.9.67` 货物错误:无法为“atk-sys v0.10.0”运行自定义构建命令 - Cargo error: failed to run custom build command for `atk-sys v0.10.0` Rust 编译错误“无法为 `freetype-sys v0.13.1' 运行自定义构建命令”win 10 - Rust compilation error " failed to run custom build command for `freetype-sys v0.13.1' " win 10 错误:无法为onig_sys v61.1.0运行自定义生成命令 - error: failed to run custom build command for `onig_sys v61.1.0` 启动 Actix-web 时出错:无法为 `brotli-sys v0.3.2` 运行自定义构建命令 - Error when getting started Actix-web: failed to run custom build command for `brotli-sys v0.3.2` 错误:无法为 `openssl v0.9.24` 运行自定义构建命令 - error: failed to run custom build command for `openssl v0.9.24` 错误:无法为“ring v0.16.20”运行自定义构建命令 - error: failed to run custom build command for `ring v0.16.20`
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM