安装环境准备: gcc libpcap-dev tcl-dev 安装步骤: #tar -zxvf hping3-200541105.tar.gz -C /usr/local/src #cd /usr/include/net #ln -s ../pcap-bpf.h bpf.h #cd /usr/local/src/hping3-20051105 #./configure #make #make install
问题容易出在红色代码那部分,如果不执行那句代码,就会出现如下错误:
[root@centos5 hping3-20051105]# ./configure build byteorder.c... create byteorder.h... ===> Found Tclsh in: /usr/bin/tclsh8.4 ==> WARNING: no Tcl header files found! -------------------------------------- system type: LINUX LIBPCAP : PCAP=-lpcap PCAP_INCLUDE : MANPATH : /usr/local/man USE_TCL : TCL_VER : 8.4 TCL_INC : LIBTCL : -ltcl8.4 -lm -lpthread TCLSH : /usr/bin/tclsh8.4 (to modify try configure --help) -------------------------------------- creating Makefile... creating dependences... now you can try `make' [root@centos5 hping3-20051105]# make gcc -c -O2 -Wall -g main.c main.c:29:18: 错误:pcap.h:没有那个文件或目录 main.c:169: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token main.c:170: 错误:‘PCAP_ERRBUF_SIZE’ 未声明 (不在函数内) make: *** [main.o] 错误 1