首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

Ubuntu 下 ARP Sniffer 源码 编译出错解决办法

2012-02-29 
Ubuntu 下 ARP Sniffer 源码 编译出错小弟最近开始学习Linux下编程在研究某大虾给的关于 ARP Sniffer的源

Ubuntu 下 ARP Sniffer 源码 编译出错
小弟最近开始学习Linux下编程 在研究某大虾给的关于 ARP Sniffer的源码的时候 遇到一个十分纠结的问题

大虾的源码在如下地址中
http://www.lslnet.com/linux/f/docs1/i03/big5120787.htm

按照他的要求 我先安装了 pcap和libnet 中间遇到各种纠结 纠缠了一整天总算搞定
然后 编译代码 gcc -I/usr/local/include -L/usr/local/lib -o sniffer sniffer.c -lpcap -lnet  
这时候 最蛋疼的事情出现了 出现了一大堆莫名其妙的错误 尤其第一个错误直指 libnet.h 这个头文件 我很郁闷 我刚装的libnet 怎么头文件里还有错误。。。

错误如下  

sniffer.c:20:19: warning: extra tokens at end of #include directive
sniffer.c:21:20: warning: extra tokens at end of #include directive
sniffer.c:22:23: warning: extra tokens at end of #include directive
sniffer.c:23:18: warning: extra tokens at end of #include directive
sniffer.c:24:20: warning: extra tokens at end of #include directive
In file included from sniffer.c:24:
/usr/include/libnet.h:87:2: error: #error "byte order has not been specified, you'll
In file included from sniffer.c:24:
/usr/include/libnet.h:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘to’
/usr/include/libnet.h:88: error: stray ‘#’ in program
/usr/include/libnet.h:89: error: missing terminating " character
sniffer.c:187: error: expected ‘)’ before ‘*’ token
sniffer.c:226: error: expected ‘)’ before ‘*’ token
sniffer.c:237: error: expected ‘)’ before ‘*’ token
sniffer.c: In function ‘printdat’:
sniffer.c:292: error: expected expression before ‘;’ token
sniffer.c:321: error: expected expreror: e
下面还有很长 但是我首先纠结的就是再libnet.h里的错误到底是啥意思?...

我用的 Ubuntu 10 gcc gnu m4 flex bison libnet 都反复更新过

实属无奈了 希望得到大家的帮助

[解决办法]
感觉 你发错版块了,换个地方回答你的人就多了,去linux专区去
[解决办法]
~~~去Ubuntu论坛问问去吧

热点排行