关于 libpcap的安装
生活随笔
收集整理的這篇文章主要介紹了
关于 libpcap的安装
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我用以下的方式安裝libpcap,
./configure
make
make install
并且用下面的代碼測試:
#include <stdio.h> #include <stdlib.h> #include <pcap.h>int main( int argc, char** argv ) {char *dev, errbuf[PCAP_ERRBUF_SIZE];dev = pcap_lookupdev( errbuf );if ( dev == NULL ){fprintf( stderr, "couldn't find default device: %s\n", errbuf );return ( 2 );}printf( "Device: %s\n", dev );return ( 0 ); }
可是在編譯的時候出現:
lx@ubuntu:~/c/test$ gcc -o test24 test24.c -lpcap/usr/local/lib/libpcap.so: undefined reference to `pcap_parse'
如是我google下 這樣就 “sudo apt-get install libpcap-dev”沒有錯誤了 只是我不知道原因,在看看的。
轉載于:https://www.cnblogs.com/lxgeek/archive/2011/03/11/1981209.html
總結
以上是生活随笔為你收集整理的关于 libpcap的安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 上海火灾暴露灾难教育缺失
- 下一篇: 我喜欢台湾