从Redis下载5.0.5 cd 到src目录 制作
这肯定对其他人也有效。关于如何解决这个问题有任何想法/提示吗?
简短版本:
在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 中:
#ifdef __CYGWIN__
#define TCP_KEEPCNT 8
#define TCP_KEEPINTVL 150
#define TCP_KEEPIDLE 14400
#endif
之后我就可以从根目录运行 make 了:
make distclean
make
这是基于 this github 对话。
希望这有帮助!
关于makefile - 如何在 Windows-10 上编译 REDIS 5.0.5,make 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56498250/