10/12/13

ipvsadm 安装错误记录

环境:centos 64bit

1、netlink错误

在包含自 libipvs.h:13 的文件中,
从 libipvs.c:23:
ip_vs.h:15:29: 错误:netlink/netlink.h:没有那个文件或目录
ip_vs.h:16:31: 错误:netlink/genl/genl.h:没有那个文件或目录
ip_vs.h:17:31: 错误:netlink/genl/ctrl.h:没有那个文件或目录

 

[root@localhost ipvsadm-1.26]# rpm -qa | grep popt
popt-1.13-7.el6.x86_64
popt-devel-1.13-7.el6.x86_64
[root@localhost ipvsadm-1.26]# rpm -qa | grep libnl
libnl-1.1-14.el6.x86_64
libnl-devel-1.1-14.el6.x86_64

这个报错处理掉了,根本原因不清楚。

2、print_largenum 函数错误

ipvsadm.c: 在函数‘print_largenum’中:
ipvsadm.c:1318: 警告:域宽 的类型应该是‘int’,但实参 2 的类型为‘size_t’
gcc -Wall -Wunused -Wstrict-prototypes -g  -DVERSION=\”1.25\” -DSCHEDULERS=\””rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq”\”  -DHAVE_NET_IP_VS_H -c -o config_stream.o config_stream.c
gcc -Wall -Wunused -Wstrict-prototypes -g  -DVERSION=\”1.25\” -DSCHEDULERS=\””rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq”\”  -DHAVE_NET_IP_VS_H -c -o dynamic_array.o dynamic_array.c
gcc -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a  -lnl
ipvsadm.o: In function `parse_options’:
/root/chen-123/ipvsadm-1.25/ipvsadm.c:395: undefined reference to `poptGetContext’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:398: undefined reference to `poptGetNextOpt’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:615: undefined reference to `poptBadOption’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:465: undefined reference to `poptGetNextOpt’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:622: undefined reference to `poptStrerror’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:622: undefined reference to `poptBadOption’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:625: undefined reference to `poptFreeContext’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:632: undefined reference to `poptGetArg’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:633: undefined reference to `poptGetArg’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:634: undefined reference to `poptGetArg’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:645: undefined reference to `poptGetArg’
/root/chen-123/ipvsadm-1.25/ipvsadm.c:648: undefined reference to `poptFreeContext’
collect2: ld 返回 1
make: *** [ipvsadm] 错误 1

 

查阅资料需要安装popt-static

[root@localhost ~]# yum install popt-static