Closed GoogleCodeExporter closed 9 years ago
I have got the same error when I build pypcap in sles11, it's caused by missing
'HAVE_PCAP_FILE' definition in config.h. And I think the root caused is that
header
file directory changed in libpcap 0.9.8.
# rpm -ql libpcap-devel-0.9.8-50.2
/usr/include/pcap
/usr/include/pcap-bpf.h
/usr/include/pcap-namedb.h
/usr/include/pcap.h
/usr/include/pcap/bpf.h
/usr/include/pcap/namedb.h
/usr/include/pcap/pcap.h
/usr/include/pcap/sll.h
/usr/include/pcap/usb.h
/usr/lib64/libpcap.a
/usr/lib64/libpcap.so
In my sles11, pcap.h is in both /usr/include and /usr/include/pcap, but the
pcap.h in
/usr/include/pcap contains the function definitions.
When we do python setup.py config, the script will find pcap.h and some
function,
and then define some macro like 'HAVE_PCAP_FILE' in config.h. As you see, it
will
find the /usr/include/pcap.h firstly, but no function could be found, and no
definition in config.h.
So you need to patch the setup.py, let it find the true pacp.h and create valid
config.h. then all is ok.
Good luck.
robin
Original comment by robin200...@gmail.com
on 18 Mar 2009 at 2:41
Can you please share what exactly you changed in setup.py?
Original comment by hacke...@gmail.com
on 15 Jul 2009 at 4:33
All I needed to do was exchange the order of the include directories as below:
$ diff -u setup.py setup.py.new
--- setup.py 2005-10-16 18:07:03.000000000 -0500
+++ setup.py.new 2009-08-22 12:21:53.000000000 -0500
@@ -42,7 +42,7 @@
dirs = [ '/usr', sys.prefix ] + glob.glob('/opt/libpcap*') + \
glob.glob('../libpcap*') + glob.glob('../wpdpack*')
for d in dirs:
- for sd in ('include', 'include/pcap', ''):
+ for sd in ('include/pcap', 'include', ''):
incdirs = [ os.path.join(d, sd) ]
if os.path.exists(os.path.join(d, sd, 'pcap.h')):
cfg['include_dirs'] = [ os.path.join(d, sd) ]
Original comment by acsp...@gmail.com
on 22 Aug 2009 at 5:25
thanks acspike. patch applied in r87.
Original comment by dugsong
on 15 Dec 2009 at 3:25
madhrachod sahi bata
Original comment by awanish...@gmail.com
on 23 Feb 2010 at 6:59
Issue 24 has been merged into this issue.
Original comment by getxs...@gmail.com
on 13 Jul 2010 at 11:10
Original issue reported on code.google.com by
saintar...@gmail.com
on 9 Mar 2009 at 5:15