我正在我的 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"