WhyCan Forum

人过留名,雁过留声,感谢各位朋友不离不弃地支持。 QQ: 516333132, 微信: whycan_cn (哇酷网/挖坑网/填坑网) admin@whycan.cn

您尚未登录。

#1 2017-11-15 15:44:45

NBIOT001
会员
注册时间: 2017-11-15
累计积分: 11

V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?

V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?
1.git clone -b spi-rebase https://github.com/Icenowy/sunxi-tools.git
2.sudo apt-get install libusb-1.0-0-dev
3.进入sunxi-tool目录后执行make && sudo make install,提示找不到libusb.h,编译失败。
4.在电脑上可以找到libusb.h,且路径已包含在export中。
如何解决?

root@51970f1e16d6:~/sunxi/sunxi-tools# make && sudo make install
Setting version information: v1.4.1-87-g78a7566

cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/   -o sunxi-fexc fexc.c script.c script_uboot.c script_bin.c script_fex.c
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/   -o sunxi-bootinfo bootinfo.c
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/  `pkg-config --cflags libusb-1.0`  -o sunxi-fel fel.c progress.c soc_info.c fel_lib.c fel-spiflash.c  `pkg-config --libs libusb-1.0`
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
fel_lib.c:26:20: fatal error: libusb.h: No such file or directory
compilation terminated.
Makefile:136: recipe for target 'sunxi-fel' failed
make: *** [sunxi-fel] Error 1
root@51970f1e16d6:~/sunxi/sunxi-tools# find / -name libusb.h
/usr/include/libusb-1.0/libusb.h

离线

#2 2017-11-15 15:45:50

沉鱼
Administrator
注册时间: 2017-09-06
累计积分: 161

Re: V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?

这个是缺库了, Ubuntu你试一试:
sudo apt-get install libusb-dev

fedora:
yum install libusb-dev

其他系统你的手动下载 libusb源码,
依次执行 configure, make, make install

离线

#3 2017-11-15 15:50:01

NBIOT001
会员
注册时间: 2017-11-15
累计积分: 11

Re: V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?

安装了这个,还是不行, 看下面。
root@51970f1e16d6:~/sunxi/sunxi-tools# sudo apt-get install libusb-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libusb-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 29.9 kB of archives.
After this operation, 231 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libusb-dev amd64 2:0.1.12-28 [29.9 kB]
Fetched 29.9 kB in 1s (17.8 kB/s)                     
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libusb-dev.
(Reading database ... 55875 files and directories currently installed.)
Preparing to unpack .../libusb-dev_2%3a0.1.12-28_amd64.deb ...
Unpacking libusb-dev (2:0.1.12-28) ...
Setting up libusb-dev (2:0.1.12-28) ...
root@51970f1e16d6:~/sunxi/sunxi-tools# make clean
make -C tests/ clean
make[1]: Entering directory '/root/sunxi/sunxi-tools/tests'
rm -rf sunxi-boards.zip sunxi-boards unify-fex
make[1]: Leaving directory '/root/sunxi/sunxi-tools/tests'
removed 'sunxi-fexc'
removed 'sunxi-bootinfo'
removed 'version.h'
root@51970f1e16d6:~/sunxi/sunxi-tools# make && sudo make install
Setting version information: v1.4.1-87-g78a7566

cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/   -o sunxi-fexc fexc.c script.c script_uboot.c script_bin.c script_fex.c
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/   -o sunxi-bootinfo bootinfo.c
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/  `pkg-config --cflags libusb-1.0`  -o sunxi-fel fel.c progress.c soc_info.c fel_lib.c fel-spiflash.c  `pkg-config --libs libusb-1.0`
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
fel_lib.c:26:20: fatal error: libusb.h: No such file or directory
compilation terminated.
Makefile:136: recipe for target 'sunxi-fel' failed
make: *** [sunxi-fel] Error 1

离线

#4 2017-11-15 15:51:42

沉鱼
Administrator
注册时间: 2017-09-06
累计积分: 161

Re: V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?

这就尴尬了, 缺的库已经装上
你用了docker?

离线

#5 2017-11-15 15:53:12

沉鱼
Administrator
注册时间: 2017-09-06
累计积分: 161

Re: V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?

$ find /usr/ |grep libusb.h
/usr/include/libusb-1.0/libusb.h


看下能不能找到这个文件?

离线

#6 2017-11-15 15:54:44

沉鱼
Administrator
注册时间: 2017-09-06
累计积分: 161

Re: V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?

看起来缺pkg-config, 你再试一试这个:

sudo apt-get install build-essential pkg-config

离线

#7 2018-09-05 10:03:03

无情一刀
会员
注册时间: 2018-09-04
累计积分: 641

Re: V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?

我想问下你这个问题是后面是怎么解决了 我也出现和你一样的问题

离线

#8 2018-09-05 10:21:26

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 8,476

Re: V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?

无情一刀 说:

我想问下你这个问题是后面是怎么解决了 我也出现和你一样的问题

什么状况?

离线

#9 2019-07-25 14:35:40

学习
会员
注册时间: 2019-07-08
累计积分: 26

Re: V3S,安装sunxi-fel烧录工具,提示找不到libusb.h,咋办?

沉鱼 说:

看起来缺pkg-config, 你再试一试这个:

sudo apt-get install build-essential pkg-config


谢谢,我也遇到了这个问题,安装了你说的这几个可以编译安装了!

离线

页脚