安装ipvsadm报错
server环境:
[vagrant@localhost download]$ uname -a
Linux RS1 2.6.18-238.el5 #1 SMP Thu Jan 13 15:51:15 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
[vagrant@localhost download]$ cat /etc/redhat-release
CentOS release 5.6 (Final)
[vagrant@localhost download]$
ipvsadm版本号(ipvsadm版本号和linux内核是有相应关系的):
ipvsadm-1.24
编译报错:
[vagrant@localhost ipvsadm-1.24]$ make
make -C libipvs
make[1]: Entering directory `/home/vagrant/download/ipvsadm-1.24/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -DHAVE_NET_IP_VS_H -c -o libipvs.o libipvs.c
In file included from libipvs.c:23:
libipvs.h:14:23: error: net/ip_vs.h: No such file or directory
In file included from libipvs.c:23:
libipvs.h:119: error: expected ‘)’ before ‘fwmark’
libipvs.c:27: error: field ‘svc’ has incomplete type
libipvs.c:28: error: field ‘dest’ has incomplete type
libipvs.c: In function ‘ipvs_init’:
libipvs.c:40: error: invalid application of ‘sizeof’ to incomplete type ‘struct ip_vs_getinfo’
libipvs.c:44: error: ‘IP_VS_SO_GET_INFO’ undeclared (first use in this function)
libipvs.c:44: error: (Each undeclared identifier is reported only once
libipvs.c:44: error: for each function it appears in.)
libipvs.c: In function ‘ipvs_getinfo’:
libipvs.c:56: error: invalid application of ‘sizeof’ to incomplete type ‘struct ip_vs_getinfo’
libipvs.c:57: error: ‘IP_VS_SO_GET_INFO’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_version’:
libipvs.c:64: error: invalid use of undefined type ‘struct ip_vs_getinfo’
libipvs.c: In function ‘ipvs_flush’:
libipvs.c:70: error: ‘IP_VS_SO_SET_FLUSH’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_add_service’:
libipvs.c:79: error: ‘IP_VS_SO_SET_ADD’ undeclared (first use in this function)
libipvs.c:79: error: dereferencing pointer to incomplete type
libipvs.c: In function ‘ipvs_update_service’:
libipvs.c:87: error: ‘IP_VS_SO_SET_EDIT’ undeclared (first use in this function)
libipvs.c:87: error: dereferencing pointer to incomplete type
libipvs.c: In function ‘ipvs_del_service’:
libipvs.c:95: error: ‘IP_VS_SO_SET_DEL’ undeclared (first use in this function)
libipvs.c:95: error: dereferencing pointer to incomplete type
libipvs.c: In function ‘ipvs_zero_service’:
libipvs.c:103: error: ‘IP_VS_SO_SET_ZERO’ undeclared (first use in this function)
libipvs.c:103: error: dereferencing pointer to incomplete type
libipvs.c: In function ‘ipvs_add_dest’:
libipvs.c:109: error: dereferencing pointer to incomplete type
libipvs.c:109: error: dereferencing pointer to incomplete type
libipvs.c:112: error: ‘IP_VS_SO_SET_ADDDEST’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_update_dest’:
libipvs.c:119: error: dereferencing pointer to incomplete type
libipvs.c:119: error: dereferencing pointer to incomplete type
libipvs.c:122: error: ‘IP_VS_SO_SET_EDITDEST’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_del_dest’:
libipvs.c:129: error: dereferencing pointer to incomplete type
libipvs.c:129: error: dereferencing pointer to incomplete type
libipvs.c:132: error: ‘IP_VS_SO_SET_DELDEST’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_set_timeout’:
libipvs.c:140: error: ‘IP_VS_SO_SET_TIMEOUT’ undeclared (first use in this function)
libipvs.c:141: error: dereferencing pointer to incomplete type
libipvs.c: In function ‘ipvs_start_daemon’:
libipvs.c:148: error: ‘IP_VS_SO_SET_STARTDAEMON’ undeclared (first use in this function)
libipvs.c:149: error: dereferencing pointer to incomplete type
libipvs.c: In function ‘ipvs_stop_daemon’:
libipvs.c:156: error: ‘IP_VS_SO_SET_STOPDAEMON’ undeclared (first use in this function)
libipvs.c:157: error: dereferencing pointer to incomplete type
libipvs.c: In function ‘ipvs_get_services’:
libipvs.c:166: error: dereferencing pointer to incomplete type
libipvs.c:167: error: invalid application of ‘sizeof’ to incomplete type ‘ipvs_service_entry_t’
libipvs.c:167: error: invalid use of undefined type ‘struct ip_vs_getinfo’
libipvs.c:172: error: dereferencing pointer to incomplete type
libipvs.c:172: error: invalid use of undefined type ‘struct ip_vs_getinfo’
libipvs.c:174: error: ‘IP_VS_SO_GET_SERVICES’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_cmp_services’:
libipvs.c:189: error: dereferencing pointer to incomplete type
libipvs.c:189: error: dereferencing pointer to incomplete type
libipvs.c:193: error: dereferencing pointer to incomplete type
libipvs.c:193: error: dereferencing pointer to incomplete type
libipvs.c:197: error: dereferencing pointer to incomplete type
libipvs.c:197: error: dereferencing pointer to incomplete type
libipvs.c:201: error: dereferencing pointer to incomplete type
libipvs.c:201: error: dereferencing pointer to incomplete type
libipvs.c: In function ‘ipvs_sort_services’:
libipvs.c:208: error: dereferencing pointer to incomplete type
libipvs.c:208: error: dereferencing pointer to incomplete type
libipvs.c:209: error: invalid application of ‘sizeof’ to incomplete type ‘ipvs_service_entry_t’
libipvs.c: In function ‘ipvs_get_dests’:
libipvs.c:218: error: dereferencing pointer to incomplete type
libipvs.c:218: error: invalid application of ‘sizeof’ to incomplete type ‘ipvs_dest_entry_t’
libipvs.c:218: error: dereferencing pointer to incomplete type
libipvs.c:224: error: dereferencing pointer to incomplete type
libipvs.c:224: error: dereferencing pointer to incomplete type
libipvs.c:225: error: dereferencing pointer to incomplete type
libipvs.c:225: error: dereferencing pointer to incomplete type
libipvs.c:226: error: dereferencing pointer to incomplete type
libipvs.c:226: error: dereferencing pointer to incomplete type
libipvs.c:227: error: dereferencing pointer to incomplete type
libipvs.c:227: error: dereferencing pointer to incomplete type
libipvs.c:228: error: dereferencing pointer to incomplete type
libipvs.c:228: error: dereferencing pointer to incomplete type
libipvs.c:231: error: ‘IP_VS_SO_GET_DESTS’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_cmp_dests’:
libipvs.c:243: error: dereferencing pointer to incomplete type
libipvs.c:243: error: dereferencing pointer to incomplete type
libipvs.c:247: error: dereferencing pointer to incomplete type
libipvs.c:247: error: dereferencing pointer to incomplete type
libipvs.c: In function ‘ipvs_sort_dests’:
libipvs.c:253: error: dereferencing pointer to incomplete type
libipvs.c:253: error: dereferencing pointer to incomplete type
libipvs.c:254: error: invalid application of ‘sizeof’ to incomplete type ‘ipvs_dest_entry_t’
libipvs.c: At top level:
libipvs.c:259: error: expected ‘)’ before ‘fwmark’
libipvs.c: In function ‘ipvs_get_timeout’:
libipvs.c:288: error: dereferencing pointer to incomplete type
libipvs.c:293: error: ‘IP_VS_SO_GET_TIMEOUT’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_get_daemon’:
libipvs.c:309: error: dereferencing pointer to incomplete type
libipvs.c:315: error: ‘IP_VS_SO_GET_DAEMON’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_strerror’:
libipvs.c:357: error: ‘ipvs_get_service’ undeclared (first use in this function)
make[1]: *** [libipvs.o] Error 1
make[1]: Leaving directory `/home/vagrant/download/ipvsadm-1.24/libipvs'
make: *** [libs] Error 2
打开Makefile,发现
INCLUDE = -I/usr/src/linux/include -I.. -I.
须要做个软连接。
进入/usr/src文件夹
[vagrant@localhost src]$ pwd
/usr/src
[vagrant@localhost src]$ ll
total 20
drwxr-xr-x 2 root root 4096 Jan 26 2010 debug
drwxr-xr-x 3 root root 4096 Nov 21 2012 kernels
lrwxrwxrwx 1 root root 49 Nov 21 2012 vboxguest-4.2.0 -> /opt/VBoxGuestAdditions-4.2.0/src/vboxguest-4.2.0
ln -s生成一个软连接。
[vagrant@localhost src]$ sudo ln -s /usr/src/kernels/2.6.18-238.el5-x86_64/ /usr/src/linux
[vagrant@localhost src]$ ll
total 24
drwxr-xr-x 2 root root 4096 Jan 26 2010 debug
drwxr-xr-x 3 root root 4096 Nov 21 2012 kernels
lrwxrwxrwx 1 root root 39 May 5 09:59 linux -> /usr/src/kernels/2.6.18-238.el5-x86_64/
lrwxrwxrwx 1 root root 49 Nov 21 2012 vboxguest-4.2.0 -> /opt/VBoxGuestAdditions-4.2.0/src/vboxguest-4.2.0
再进行编译安装ipvsadm就成功了。
相关文章
- pycharm中运行lua脚本requier sys报错_pycharm怎么安装jupyter
- pycharm安装库报错_pycharm安装numpy失败
- centos 安装python3导致yum报错
- virtualbox增强功能-VBoxGuestAdditions安装
- 【Bug解决】Win10安装pycocotools报错
- yum直接安装docker-ce报错找不到安装包
- eclipse配置tomcat安装及配置教程_vbras部署教程
- PDF编辑软件|Adobe Acrobat DC安装教程(图文),附安装包下载
- CAD制图安装包下载AutoCAD 2010软件安装包资源免费下载以及安装教程
- docker中安装es和kibana
- 解决Mac安装PS AI PR AE系列软件报错代码501的解决方案
- window安装docker desktop打开报错问题
- 三维动画maya软件中文版,maya软件2023版安装教程下载
- 【Android 内存优化】libjpeg-turbo 函数库交叉编译 ( libjpeg-turbo 函数库下载 | libjpeg-turbo 编译文档 | 环境准备 | NASM 安装 )
- 【错误记录】Python 安装依赖库报错 ( ERROR: Could not find a version that satisfies the requirement elftools )
- win x64下安装oracle 12c出现INS-30131报错的解决方法
- 解决Oracle安装暂挂的方法(oracle安装暂挂)
- Linux下安装FTP服务的简单操作(linux安装ftp命令)
- Linux安装之——刻录自由的磁盘(linux刻盘)
- 如何在 Linux 上安装 Python
- Oracle10g安装失败,报错信息怎么办?——解决方法分享(oracle10g安装报错)
- Linux系统如何安装和使用MySQL数据库?(linux中mysql)
- 在CMD中安装MySQL时遇到错误(cmd安装mysql报错)
- 解决源码安装redis报错问题(源码安装redis报错)
- 基于Arm平台上安装Oracle精彩记录(arm平台oracle)
- Yum安装Redis 5,一步到位(yum redis5)
- Redis集群安装踩坑指南(redis集群安装报错)
- centos下编译安装mysql报错解决方案
- node.js使用npm安装插件时提示installError:ENOENT报错的解决方法