redis 6.0安装编译报错

文章描述了在编译redis源码时遇到的错误,由于gcc版本过低,`struct redisServer`中没有找到如`unixsocket`、`supervised_mode`等成员。解决方法是升级gcc到9.0以上,通过yum安装devtoolset-9并启用,最后验证gcc版本确保升级成功。
摘要由CSDN通过智能技术生成

server.c:5151:94: error: ‘struct redisServer’ has no member named ‘unixsocket’

serverLog(LL_NOTICE,“The server is now ready to accept connections at %s”, server.unixsocket);

^

server.c:5152:19: error: ‘struct redisServer’ has no member named ‘supervised_mode’

if (server.supervised_mode == SUPERVISED_SYSTEMD) {

^

server.c:5153:24: error: ‘struct redisServer’ has no member named ‘masterhost’

if (!server.masterhost) {

^

server.c:5166:15: error: ‘struct redisServer’ has no member named ‘maxmemory’

if (server.maxmemory > 0 && server.maxmemory < 10241024) {

^

server.c:5166:39: error: ‘struct redisServer’ has no member named ‘maxmemory’

if (server.maxmemory > 0 && server.maxmemory < 10241024) {

^

server.c:5167:176: error: ‘struct redisServer’ has no member named ‘maxmemory’

serverLog(LL_WARNING,“WARNING: You specified a maxmemory value that is less than 1MB (current value is %llu bytes). Are you sure this is what you really want?”, server.maxmemory);

^

server.c:5170:31: error: ‘struct redisServer’ has no member named ‘server_cpulist’

redisSetCpuAffinity(server.server_cpulist);

原因:这个是gcc版本过低导致的,升级gcc版本到9.0以上即可解决。

解决方案:

yum -y install centos-release-scl

yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils

scl enable devtoolset-9 bash

gcc -v        查看gcc版本

echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile    长期生效

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值