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/linux在server并不存在。

须要做个软连接。

进入/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就成功了。

安装ipvsadm报错的更多相关文章

  1. python27(32位)安装模块报错“error: Unable to find vcvarsall.bat”

    1)首先,下载一个Microsoft Visual C++ Compiler for Python 2.7的补丁,下载地址在这里: http://www.microsoft.com/en-us/dow ...

  2. Sql Server 2008卸载后再次安装一直报错

    sql server 2008卸载之后再次安装一直报错问题. 第一:由于上一次的卸载不干净,可参照百度完全卸载sql server2008 的方式 1. 用WindowsInstaller删除所有与S ...

  3. Python virtualenv安装库报错SSL: CERTIFICATE_VERIFY_FAILED

    Python virtualenv安装库报错SSL: CERTIFICATE_VERIFY_FAILED 问题描述 使用pip按照virtualenv报错,如下: pip install virtua ...

  4. [原创] ubuntu下安装scrapy报错 error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    Ubuntu14.04在virtualenv下安装scrapy报错,Failed building wheel for cffi,lxml,cryptography 等. error: command ...

  5. Sybase ASE安装过程报错,无法创建数据库设备[AM fork() failed]

    今天同事要搭建一套测试环境,安装开发版的SYBASE ASE 15.03 Windows平台下的,发现安装过程中到了创建数据库设备的环节就开始报错了,报错信息如下: 03/24/14 09:31:44 ...

  6. 安装mysql-python报错:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 65: ordinal not in range(128)

    安装mysql-python报错: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 65: ordinal n ...

  7. python︱模块加载(pip安装)以及pycharm安装与报错解决方式

    每每以为攀得众山小,可.每每又切实来到起点,大牛们,缓缓脚步来俺笔记葩分享一下吧,please~ --------------------------- 准备放下R开始学python,真是痛苦,因为找 ...

  8. 安装STS报错(三)

    安装STS报错 1.具体报错如下 Failure to transfer org.codehaus.plexus:plexus-archiver:jar:1.2 from http://repo.ma ...

  9. 安装STS报错(二)

    安装STS报错 1.启动时报错 2.报错原因 3.处理办法

随机推荐

  1. 百度SiteApp构建网站APP

    现在很多个人网站和企业网站都是传统的Web方式,有没有想过个人/企业网站也能做成APP应用对外宣传呢?专门找人去开发Android和IOS上的APP又太贵,为了赶上移动互联网时髦,我以个人网站试做了一 ...

  2. AppCode3 常用 设置 及 快捷键 (持续更新)

    以下设置都可以通过 设置中的搜索框 进行关键字搜索 0, 打开Project 设置 Command + ; 1, 打开设置快捷键 Command + , 2, 显示行号 Editor -> Ap ...

  3. 语法糖----JAVA

    语法糖 语法糖(Syntactic Sugar),也叫糖衣语法,是英国计算机科学家彼得·约翰·兰达(Peter J. Landin)发明的一个术语.指的是,在计算机语言中添加某种语法,这种语法能使程序 ...

  4. 说服式设计(persuasive design)的行为模型

    转自:http://www.sharetk.com/html/ued/User-Research/1404.html 一 模型简介 BJ Fogg提出了一个新的理解人类行为的模型,他称之为Fogg b ...

  5. Hadoop集群配置(最全面总结)

    Hadoop集群配置(最全面总结) 通常,集群里的一台机器被指定为 NameNode,另一台不同的机器被指定为JobTracker.这些机器是masters.余下的机器即作为DataNode也作为Ta ...

  6. 更新整理本人全部博文中提供的代码与工具(Java,2014.09)

    为了更方便地管理博文中涉及的各种代码与工具资源,如今把这些资源迁移到 GitHub 中,有兴趣者可前往下载. Java 1.<高效 Java Web 应用开发框架 JessMA v3.4.1 正 ...

  7. YouTube为什么打不开?以及简便的訪问的方法/解决方式!

    在站点统计中看到好多人通过百度或者谷歌(Google)搜索引擎搜:YouTube怎么上不去,怎样不用代理server訪问YouTube,YouTube上不去的解决的方法,YouTube怎样訪问等等.事 ...

  8. 全栈project师的悲与欢

    从小米辞职出来创业的两个多月里,通过猎头或自己投简历,先后面试了知乎,今日头条,豌豆荚,美团,百度,App Annie,去哪儿,滴滴打车等技术团队,一二面(技术面)差点儿都轻松的过了,三面却没有毕业那 ...

  9. 点击datalist中Button按钮出现“回发或回调参数无效......”

        遇到问题: 回发或回调参数无效.在配置中使用 <pages enableEventValidation="true"/> 或在页面中使用 <%@ Page ...

  10. tomcat设置IP地址或者域名访问

    链接地址:http://jingyan.baidu.com/article/7e440953dc096e2fc0e2ef1a.html 本文介绍如何通过修改tomcat的配置,实现通过IP地址或者域名 ...