libusb库安装(Ubuntu)
下载源码
点击下载源码
解压源码压缩包,编译源码
cd ~/Documents/Study/libusb-1.0.22
- 第二步执行配置文件进行配置,建议sudo执行,一般这一步会报一下错,告诉你缺少一些库文件,按照需求,按照报错的库名字去添加即可,这个需要看个人的google水平了
sudo ./configure
//我遇到的是如下错误
checking for inline... inline
checking operating system... Linux
checking for library containing clock_gettime... -lrt
checking libudev.h usability... no
checking libudev.h presence... no
checking for libudev.h... no
configure: error: "udev support requested but libudev not installed"
//解决方法:
sudo apt-get install libudev-dev
sudo make && make install
ll /usr/local/lib/
total 1252
drwxr-xr-x 5 root root 4096 Mar 29 10:26 ./
drwxr-xr-x 14 root root 4096 Jul 17 2018 ../
lrwxrwxrwx 1 root root 19 Mar 29 10:26 libusb-0.1.so.4 -> libusb-0.1.so.4.4.4*
-rwxr-xr-x 1 root root 70544 Mar 29 10:26 libusb-0.1.so.4.4.4*
-rw-r--r-- 1 root root 689362 Mar 28 17:53 libusb-1.0.a
-rwxr-xr-x 1 root root 970 Mar 28 17:53 libusb-1.0.la*
lrwxrwxrwx 1 root root 19 Mar 28 17:53 libusb-1.0.so -> libusb-1.0.so.0.1.0*
lrwxrwxrwx 1 root root 19 Mar 28 17:53 libusb-1.0.so.0 -> libusb-1.0.so.0.1.0*
-rwxr-xr-x 1 root root 396880 Mar 28 17:53 libusb-1.0.so.0.1.0*
-rw-r--r-- 1 root root 89218 Mar 29 10:26 libusb.a
-rwxr-xr-x 1 root root 984 Mar 29 10:26 libusb.la*
lrwxrwxrwx 1 root root 19 Mar 29 10:26 libusb.so -> libusb-0.1.so.4.4.4*
参考链接
Linux libusb 安装及简单使用