`openocd` 配置脚本找不到 `libusb`

`openocd` 配置脚本找不到 `libusb`

我正在我的 Debian Stretch 系统上安装 OpenOCD。当我运行./configure它时报告找不到 libusb。

...
checking for LIBUSB1... no
configure: WARNING: libusb-1.x not found, trying legacy libusb-0.1 as a fallback; consider installing libusb-1.x instead
checking for LIBUSB0... no
...

我安装了正确的依赖项,但仍然收到错误。

libhidapi-libusb0/stable,now 0.8.0~rc1+git20140818.d17db57+dfsg-1 amd64 [installed,automatic]
libusb-1.0-0/stable,now 2:1.0.21-1 amd64 [installed,automatic]
libusb-1.0-0-dev/stable,now 2:1.0.21-1 amd64 [installed]

是什么赋予了?

答案1

该错误消息充其量也没有什么帮助。

OpenOCDREADME列为pkg-config依赖项。pkg-config安装后,./configure脚本就能够找到libusb-1.0-0-dev.

...
checking for LIBUSB1... yes
configure: libusb-1.0 header bug workaround: LIBUSB1_CFLAGS changed to "-isystem /usr/include/libusb-1.0"
checking for LIBUSB0... no
...

太长了;博士

sudo apt-get install pkg-config

答案2

sudo aptitude install libusb-1.0-0

sudo aptitude install libhidapi-dev

sudo aptitude install libftdi-dev

./configure --prefix=/usr/local --enable-doxygen-pdf --enable-verbose --enable-verbose-usb-io --enable-verbose-usb-comms --enable-usbprog --enable-cmsis-dap LIBUSB1_CFLAGS="-isystem /usr/include/libusb-1.0"

相关内容