下载msys2
Index of /msys2/distrib/x86_64/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
下载redis-7.0.12
https://github.com/redis/redis/archive/7.0.12.tar.gz
解压缩到D:\redis-7.0.12
编辑
D:\msys64\etc\pacman.d
后缀为mingw32的:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686Index of /msys2/mingw/i686/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
mingw64的:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64Index of /msys2/mingw/x86_64/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
msys的:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch
pacman -Sy
将本地的包数据库与远程的仓库进行了同步
pacman -S gcc make
安装gcc与make
pacman -S pkg-config
安装pkg-config
修改头文件,避免编译报错
E:\msys64\usr\include\dlfcn.h
删除 #if GUN_VIIBLE
和 #endif
释放typedef stauct Dl_info Dl_info;
和下面的struct Dl_info
代码
//#if __GNU_VISIBLE
typedef struct Dl_info Dl_info;
struct Dl_info
{
char dli_fname[PATH_MAX]; /* Filename of defining object */
void *dli_fbase; /* Load address of that object */
const char *dli_sname; /* Name of nearest lower symbol */
void *dli_saddr; /* Exact value of nearest symbol */
};
extern int dladdr (const void *addr, Dl_info *info);
//#endif
Copy
编译
cd /d/redis-7.0.12
make PREFIX=/d/redis-7.0 install
编译成功
D:\msys64\usr\bin\msys-2.0.dll copy到 D:\redis-7.0\bin
D:\redis-7.0\下的
redis.conf 和 sentinel.conf copy到 D:\redis-7.0\bin
为了不和之前安装的冲突
redis.conf 和 sentinel.conf端口号 改为6379
启动
redis-server.exe redis.conf