Debian

openocd 配置腳本找不到libusb

  • January 29, 2019

我正在我的 Debian 伸展系統上安裝 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]

是什麼賦予了?

錯誤消息充其量是沒有幫助的。

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
...

tl;博士

sudo apt-get install pkg-config
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"

引用自:https://unix.stackexchange.com/questions/493785