当前位置:网站首页>Using external Libpcap library on ARM platform

Using external Libpcap library on ARM platform

2022-06-24 23:35:00 mialo163

One . Cross compilation libpcap

1、 download libpcap, I downloaded it libpcap-1.8.1.tar.gz

2、 decompression

3、 You may need to install some dependencies before compiling , perform yum install flex byacc bison -y

3、 Get into libpcap-1.8.1 Catalog , Select the applicable cross compiler first ( I've tried two platforms aarch64-linux-gnu-gcc/arm-linux-gnueabihf-gcc)

export CC=arm-linux-gcc,

or export CC=arm-linux-gnueabihf-gcc,

or export CC=aarch64-linux-gnu-gcc,

 

Then configure , perform ./configure --host=arm-linux --with-pcap=linux

4、configure After execution , Input make Command to compile . When the compilation is complete, it will generate libpcap.a Static and dynamic libraries . These two libraries are what we need .

Two . Copy .a Static library to compiler lib Folder

Such as :/usr/aarch64-linux-gnu/lib

3、 ... and . Compile with -lpcap

Such as :aarch64-linux-gnu-gcc test.c -o test -lpcap

原网站

版权声明
本文为[mialo163]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211119255690.html