Makefile 如何在Windows-10上编译REDIS 5.0.5,make中的错误
从下载的5.0.5 cd到src目录 制造 这肯定对其他人有用。关于如何解决这个问题有什么想法/想法吗 简短版本: 在net.c中Makefile 如何在Windows-10上编译REDIS 5.0.5,make中的错误,makefile,redis,compilation,windows-10,mingw-w64,Makefile,Redis,Compilation,Windows 10,Mingw W64,从下载的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
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) {
^~
然后
最后
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
#ifndef TCP_KEEPCNT
#define TCP_KEEPCNT 8
#endif
#ifndef TCP_KEEPINTVL
#define TCP_KEEPINTVL 150
#endif
#ifndef TCP_KEEPIDLE
#define TCP_KEEPIDLE 14400
#endif
之后,我可以从根目录运行make:
make distclean
make
这是基于github对话的
希望这有帮助 你可以试一试
第一步:从线路上拆下段'-std=c99' $(CC)-std=c99-pedantic-c$(真实)$< 在文件Makefile中,位于。\redis-5.0.5\deps\hiredis下 Ste 2:
在include deps/hiredis/net.c之后的“include”语句后面添加以下段:
#ifdef __CYGWIN__
#define TCP_KEEPCNT 8
#define TCP_KEEPINTVL 150
#define TCP_KEEPIDLE 14400
#endif
#ifndef TCP_KEEPCNT
#define TCP_KEEPCNT 8
#endif
#ifndef TCP_KEEPINTVL
#define TCP_KEEPINTVL 150
#endif
#ifndef TCP_KEEPIDLE
#define TCP_KEEPIDLE 14400
#endif