squid make时报错 :ext_file_userip_acl.cc:254: error: ‘errno’ was not declared in this

本文记录了在CentOS 6.2和5.8上安装Squid过程中遇到的各种编译错误及解决方案,包括找不到文件目录、未声明标识符等问题,并提供了解决这些问题的具体步骤。

出现的错误是

forward.c:43:44: linux/netfilter_ipv4/ip_tproxy.h: No such file or directory
forward.c: In function `fwdConnectStart':
forward.c:466: error: storage size of 'itp' isn't known
forward.c:599: error: `TPROXY_ASSIGN' undeclared (first use in this function)
forward.c:599: error: (Each undeclared identifier is reported only once
forward.c:599: error: for each function it appears in.)
forward.c:600: error: `IP_TPROXY' undeclared (first use in this function)
forward.c:606: error: `TPROXY_FLAGS' undeclared (first use in this function)
forward.c:607: error: `ITP_CONNECT' undeclared (first use in this function)
forward.c:466: warning: unused variable `itp'
make[3]: *** [forward.o] Error 1
make[3]: Leaving directory `/usr/local/src/squid-2.6.STABLE13/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/squid-2.6.STABLE13/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/squid-2.6.STABLE13/src'
make: *** [all-recursive] Error 1

---------------------------------------------------------------------------------------------------------------------------------------------------------

centos6.2 centos5.8 32位老至强2.8

./configure –prefix=/usr/local/squid --with-filedescriptors=20480

make时报错:
ext_file_userip_acl.cc:254: error: ‘errno’ was not declared in this scope

修改
helpers/external_acl/file_userip/ext_file_userip_acl.cc

#include "util.h"
下面加一行
#include <cerrno>


make && make install

---------------------------------------------------------------------------------------------------------------------------------------------------------

另centos5.8 gcc 4.1.2 make时报错:
ipc/.libs/libipc.a(PageStack.o): In function `Ipc::Atomic::WordT::operator+=(int)’:
/root/squid-3.2.1/src/ipc/../../src/ipc/AtomicWord.h:31: undefined reference to `__sync_add_and_fetch_4′
collect2: ld returned 1 exit status

需要在CFLAGS中设置-march 如下:

./configure CFLAGS=”-march=pentium4″ CXXFLAGS=”-march=pentium4″

根据cpu和gcc版本的不同,更多的CFLAGS选项见这里:

http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Core_2_Duo.2FQuad.2C_Xeon_51xx.2F53xx.2F54xx.2F3360.2C_Pentium_Dual-Core_T23xx.2B.2FExxxx.2C_Celeron_Dual-Core



点击链接(http://www.zhaokunyao.com/archives/3974)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值