开发者

libpcap with python and C fails "undefined reference to pcap_parse"

This is a bit of a two pronged question. Using Ubuntu 11.04, and Python 2.7

My problem started when I was trying to compile a C program to capture and decode IP packets. When compiling, I get this error $ gcc -lpcap decode_sniff.c /usr/local/lib/libpcap.so: undefined reference to `pcap_parse' collect2: ld returned 1 exit status

I confirmed and re-confirmed that libnet1-dev and libpcap-dev are installed (using apt-get).

Eventually I gave up on the C program and went to work with Python instead. I installed and built the pypcap package (http://pycap.sourceforge.net/). However, when trying to import the pypcap module, I get ;

Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import pycap.capture Traceback (most recent call last): File "", line 1, in ImportError: /usr/local/lib/libpcap.so.1: undefined symbol: pcap_parse

开发者_如何学C

Clearly I am missing a common file or package or module or something. I've googled this for a while now and haven't gotten anywhere. Does anyone have some insight for me?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜