Linux/Python学习论坛-京峰教育

 找回密码
 立即注册

一键登录:

搜索
热搜: 活动 交友 discuz
查看: 1057|回复: 0

解决keepalived安装错误一例

[复制链接]

238

主题

288

帖子

1925

积分

超级版主

Rank: 8Rank: 8

积分
1925
QQ
发表于 2015-3-27 13:39:20 | 显示全部楼层 |阅读模式

Keepalived安装错误一例(make错误)
在make的时候出现了下面错误:
===============================================================
/usr/include/sys/types.h:62: 错误:与 ‘dev_t’ 类型冲突
/usr/src/kernels/2.6.18-238.19.1.el5-i686//include/linux/types.h:22: 错误:‘dev_t’ 的上一个声明在此
/usr/include/sys/types.h:67: 错误:与 ‘gid_t’ 类型冲突
/usr/src/kernels/2.6.18-238.19.1.el5-i686//include/linux/types.h:54: 错误:‘gid_t’ 的上一个声明在此
/usr/include/sys/types.h:72: 错误:与 ‘mode_t’ 类型冲突
/usr/src/kernels/2.6.18-238.19.1.el5-i686//include/linux/types.h:24: 错误:‘mode_t’ 的上一个声明在此
/usr/include/sys/types.h:77: 错误:与 ‘nlink_t’ 类型冲突
/usr/src/kernels/2.6.18-238.19.1.el5-i686//include/linux/types.h:25: 错误:‘nlink_t’ 的上一个声明在此
/usr/include/sys/types.h:82: 错误:与 ‘uid_t’ 类型冲突
/usr/src/kernels/2.6.18-238.19.1.el5-i686//include/linux/types.h:53: 错误:‘uid_t’ 的上一个声明在此
In file included from /usr/include/sys/types.h:133,
                 from /usr/include/sys/uio.h:24,
                 from /usr/include/sys/socket.h:27,
                 from /usr/include/netinet/in.h:24,
                 from ip_vs.h:12,
                 from ip_vs_nl_policy.c:1:
/usr/include/time.h:105: 错误:与 ‘timer_t’ 类型冲突
/usr/src/kernels/2.6.18-238.19.1.el5-i686//include/linux/types.h:31: 错误:‘timer_t’ 的上一个声明在此
In file included from /usr/include/sys/types.h:220,
                 from /usr/include/sys/uio.h:24,
                 from /usr/include/sys/socket.h:27,
                 from /usr/include/netinet/in.h:24,
                 from ip_vs.h:12,
                 from ip_vs_nl_policy.c:1:
/usr/include/sys/select.h:78: 错误:与 ‘fd_set’ 类型冲突
/usr/src/kernels/2.6.18-238.19.1.el5-i686//include/linux/types.h:21: 错误:‘fd_set’ 的上一个声明在此
In file included from /usr/include/sys/uio.h:24,
                 from /usr/include/sys/socket.h:27,
                 from /usr/include/netinet/in.h:24,
                 from ip_vs.h:12,
                 from ip_vs_nl_policy.c:1:
/usr/include/sys/types.h:235: 错误:与 ‘blkcnt_t’ 类型冲突
/usr/src/kernels/2.6.18-238.19.1.el5-i686//include/linux/types.h:142: 错误:‘blkcnt_t’ 的上一个声明在此
make[2]: *** [ip_vs_nl_policy.o] 错误 1
make[2]: Leaving directory `/usr/local/src/keepalived-1.2.2/keepalived/libipvs-2.6'
make[1]: *** [all] 错误 1
make[1]: Leaving directory `/usr/local/src/keepalived-1.2.2/keepalived'
make: *** [all] 错误 2
===============================================================

我的编译参数是这样的:

./configure --prefix=/usr/local/keepalived --with-kernel-dir=/usr/src/kernels/2.6.18-238.19.1.el5-i686/

解决方法:
进入源码目录就是你解压的目录了:
cd /usr/local/src/keepalived-1.2.2

vi keepalived/libipvs-2.6/ip_vs.h
找到下面一行:
#include <linux/types.h>        /* For __beXX types in userland */

把他放到下面一行的下面:
#include <sys/types.h>

我想我说明白了,这是最新版本的问题,如果用keepalived-1.2.1则不会出现这个问题了,我用的是keepalived-1.2.2宝贝。


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|京峰教育,只为有梦想的人 ( 京ICP备15013173号 )

GMT+8, 2019-6-16 06:46 , Processed in 0.037513 second(s), 13 queries , Apc On.

快速回复 返回顶部 返回列表