安装cargo-flash时提示“找不到系统库libudev”如何解决?

问题描述 投票:0回答:1

操作系统:Ubuntu

  • 命令 1:
    rustup update
    --> 成功
  • 命令 2:
    rutstup target install thumbv7m-none-eabi
    --> 成功
  • 命令 3:
    cargo install cargo-flash
error: failed to run custom build command for `hidapi v1.4.2`
process didn't exit successfully: `/tmp/cargo-installgobLzf/release/build/hidapi-aad2646622c847a4/build-script-build` (exit status: 101)
error: could not find system library 'libudev' required by the 'hidapi' crate
error: failed to compile `cargo-flash v0.13.0`, intermediate artifacts can be found at `/tmp/cargo-installgobLzf`
rust stm32 rust-cargo
1个回答
19
投票

首先安装依赖项,然后安装cargo-flash:

sudo apt install -y pkg-config libusb-1.0-0-dev libftdi1-dev
sudo apt-get install libudev-dev

然后再次重试原来的命令:

cargo install cargo-flash

详情请访问cargo-flash crate

© www.soinside.com 2019 - 2024. All rights reserved.