如何在Windows-10上编译REDIS 5.0.5,make中的错误 [英] How to compile REDIS 5.0.5 on Windows-10, error in make

查看:253
本文介绍了如何在Windows-10上编译REDIS 5.0.5,make中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Redis 下载了5.0.5.cd到src目录做

Downloaded 5.0.5 from Redis cd to src directory make

这肯定对其他人有用.关于如何解决此问题的任何想法/提示?

Surely this must work for someone else out there. Any idea/ hintg about how to fix this?

短版:

net.c ...

make[3]: Entering directory '/cygdrive/c/Users/pmoran/Downloads/redis-5.0.5/deps/hiredis'
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c

net.c:270:21: error: storage size of ‘hints’ isn’t known
 struct addrinfo hints, *servinfo, *bservinfo, *p, *b;
                 ^~~~~

及以后

net.c:337:40: error: dereferencing pointer to incomplete type ‘struct addrinfo’
 for (p = servinfo; p != NULL; p = p->ai_next) {
                                    ^~

然后

make[3]: *** [Makefile:156: net.o] Error 1
make[3]: Leaving directory '/cygdrive/c/Users/pmoran/Downloads/redis-5.0.5/deps/hiredis'
make[2]: *** [Makefile:46: hiredis] Error 2
make[2]: Leaving directory '/cygdrive/c/Users/pmoran/Downloads/redis-5.0.5/deps'

最后

cc: error: ../deps/hiredis/libhiredis.a: No such file or directory
cc: error: ../deps/lua/src/liblua.a: No such file or directory
make[1]: *** [Makefile:219: redis-server] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/pmoran/Downloads/redis-5.0.5/src'
make: *** [Makefile:6: all] Error 2

推荐答案

我遇到了同样的问题,我发现最好的解决方案是使用旧版本的Redis.Redis 3.2.13最近进行了更新(2019年3月),因此它具有我需要的所有功能.如果使用它,则必须在"include"语句之后将以下内容添加到redis-3.2.13/deps/hiredis/net.c中:

I had the same exact problem and I found the best solution was to use an older version of redis. Redis 3.2.13 was updated recently (March 2019) so it has all the functionality I need. If you use it, you do have to add the following to redis-3.2.13/deps/hiredis/net.c after the 'include' statements:

    #ifdef __CYGWIN__
    #define TCP_KEEPCNT 8
    #define TCP_KEEPINTVL 150
    #define TCP_KEEPIDLE 14400
    #endif

之后,我可以从根目录运行make:

After that I was able to run make from the root directory:

make distclean
make

这基于 github对话.

This is based on this github conversation.

希望这会有所帮助!

这篇关于如何在Windows-10上编译REDIS 5.0.5,make中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆