cygwin下编译haproxy

最近在cygwin下编译安装了不少程序软件,比如nginx、mysql、php、mysql-proxy之类的,基本都很顺利。今天编译haproxy的时候遇到了一些问题。

我下载的是haproxy 1.3.14.4。编译命令:
make TARGET=generic USE_STATIC_PCRE=1

结果抛出这些错误信息
$ make TARGET=generic USE_STATIC_PCRE=1
gcc -Iinclude -Wall -O2 -g       -DTPROXY -DENABLE_POLL -DUSE_PCRE -I/usr/include  -DCONFIG_HAPROXY_VERSION=\"1.3.14.4\"
 -DCONFIG_HAPROXY_DATE=\"2008/03/20\" -c -o src/log.o src/log.c
src/log.c: In function `tcp_sess_log':
src/log.c:321: error: `INET6_ADDRSTRLEN' undeclared (first use in this function)
src/log.c:321: error: (Each undeclared identifier is reported only once
src/log.c:321: error: for each function it appears in.)
src/log.c:334: error: `AF_INET6' undeclared (first use in this function)
src/log.c:335: error: dereferencing pointer to incomplete type
src/log.c:363: error: dereferencing pointer to incomplete type
src/log.c:363: error: dereferencing pointer to incomplete type
src/log.c:363: error: dereferencing pointer to incomplete type
src/log.c:363: error: dereferencing pointer to incomplete type
src/log.c:321: warning: unused variable `pn'
make: *** [src/log.o] 错误 1

原因应该是cygwin还不支持ipv6吧。

在google查询了一下,找到一个cygwin ipv6的补丁,下载下来,解压到cygwin安装目录,覆盖掉一些文件。
再编译,提示:
$ make TARGET=generic USE_STATIC_PCRE=1
gcc -Iinclude -Wall -O2 -g       -DTPROXY -DENABLE_POLL -DUSE_PCRE -I/usr/include  -DCONFIG_HAPROXY_VERSION=\"1.3.14.4\"
 -DCONFIG_HAPROXY_DATE=\"2008/03/20\" \
              -DBUILD_TARGET='"generic"' \
              -DBUILD_CPU='"generic"' \
              -DBUILD_CC='"gcc"' \
              -DBUILD_CFLAGS='"-O2 -g"' \
              -DBUILD_OPTIONS='"USE_STATIC_PCRE=1"' \
               -c -o src/haproxy.o src/haproxy.c
In file included from /usr/include/sys/socket.h:15,
                 from src/haproxy.c:44:
/usr/include/cygwin/socket.h:50:47: cygwin/uio.h: No such file or directory
make: *** [src/haproxy.o] 错误 1

找不到uio.h头文件?奇怪我记得这个文件在cygwin下是有的啊。找了一下,果然在/usr/include/sys下有这个文件,把它复制到/usr/include/cygwin目录下,再编译,O啦。

顺便说一下,我觉得cygwin真是挺强大的。还有,C语言写的东西,跨平台能力真强。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值