libpcap arm移植

54 篇文章 2 订阅
11 篇文章 0 订阅

libpcap

a portable C/C++ library for network traffic capture.

下载

http://www.tcpdump.org/#latest-release
或者到这里:http://download.csdn.net/detail/chinaeran/8631799

编译

此处使用 arm-linux-gnueabihf-gcc,--build 使用的是64位Linux,可以不添加此参数
解压后运行如下命令:

$ ./configure --host=arm-linux-gnueabihf --build=i686-pc-linux

报错如下:
configure: error: pcap type not determined when cross-compiling; use--with-pcap=… follow 解决**方法:
将 configure 文件中的如下内容注释掉

# if test -z "$with_pcap" && test "$cross_compiling" = yes; then
#     as_fn_error $? "pcap type not determined when cross-compiling; use --with-pcap=..." "$LINENO" 5
# fi

继续

$ ./configure --host=arm-linux-gnueabihf --build=i686-pc-linux

报错
configure: error: Your operating system’s lex is insufficient to compile
libpcap. flex is a lex replacement that has many advantages, including
being able to compile libpcap. For more information, see
http://www.gnu.org/software/flex/flex.html .

安装flex

$ sudo apt-get install flex
$ ./configure --host=arm-linux-gnueabihf --build=i686-pc-linux
$ make

依然报错
make: yacc: Command not found

安装byacc

$ sudo apt-get install byacc
$ make

终于成功啦!!!
目标路径:./.libs/libcconv.so.0.0.0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

a_ran

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值