linux下c++连接redis,需要安装redis,同时还需要安装hiredis,hiredis是c++操作redis的api库。redis的安装这里不介绍了,很多教程。这里直接从hiredis安装说起。
1、下载hiredis,并解压。https://github.com/redis/hiredis
[root@server software]# wget https://github.com/redis/hiredis/archive/v0.14.0.tar.gz
[root@server software]# tar -xzf v0.14.0.tar.gz
[root@server software]# ls
hiredis-0.14.0 maven v0.14.0.tar.gz
[root@server software]# rm -f v0.14.0.tar.gz
[root@server software]# ls
hiredis-0.14.0 maven
[root@server software]# cd hiredis-0.14.0/
[root@server hiredis-0.14.0]# ls
adapters async.c CHANGELOG.md dict.c examples hiredis.c Makefile net.h read.h sdsalloc.h sds.h win32.h
appveyor.yml async.h COPYING dict.h fmacros.h hiredis.h net.c read.c README.md