arpd包安装问题两例

问题1:
在centos5.3系统下安装honeyd时,相关库包arpd-0.2,在编译时,编译通不过,报告如下错误:
cd '/usr/local/lib/arpd' && gmake -k 'arpd.o'
正在编译 arpd.c (gcc)
arpd.c: In function ‘arpd_send’:
arpd.c:269: 错误:expected ‘)’ before string constant
arpd.c: In function ‘arpd_lookup’:
arpd.c:286: 错误:expected ‘)’ before string constant
arpd.c:295: 错误:expected ‘)’ before string constant
arpd.c:298: 错误:expected ‘)’ before string constant
arpd.c: In function ‘arpd_recv_cb’:
arpd.c:427: 错误:expected ‘)’ before string constant
gmake: *** [arpd.o] 错误 1
*** 退出状态:2 ***
(这是在KDevelog工具中编译的结果)

解决方法:
    在arpd.c文件首部加上#define __FUNCTION__ “”语句

原因分析:
syslog(LOG_DEBUG, __FUNCTION__ ": no entry for %s",addr_ntoa(addr));函数中常量__FUNCTION__为预定义,该函数是操作系统中的库函数,你可以在/usr/include/sys/中找到syslog.h头文件中有它的定义,具体定义如下:
extern void syslog (int __pri, __const char *__fmt, ...)
     __attribute__ ((__format__ (__printf__, 2, 3)));

问题2:
arpd包编译成功后,连接生成arpd二进制程序,在linux下运行时,出现如下错误:
[root@ZHAO lib]# ./arpd/arpd
./arpd/arpd: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

解决方法:
方法一:直接把libevent-1.4.so.2文件拷贝到系统指定的/usr/lib库文件目录中。
方法二:设置/etc/ld.so.conf文件,编辑该文件,在文件中加入libevent-1.4.so.2所在的目录,保存后退出。需要注意的是,每次改动ld.so.conf之后需要运行ldconfing来确认刷新。

原因分析:
arpd运行时,需要libevent库的支持,所以在运行arpd前,要先编译好libevent包,并把产生的libevent-1.4.so.2文件拷贝到系统默认的库文件目录下,以便arpd运行时能够连接到。

 

以上是个人的观点,有错误的地方还请多多指教。

Email:dezhaoxu@163.com

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值