博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Building Redis for use on Cygwin(转)
阅读量:7187 次
发布时间:2019-06-29

本文共 1826 字,大约阅读时间需要 6 分钟。

This is the second time I have installed Redis for use on Cygwin in the last several months. It seems that each time the version numbers change, I step in a different hole. For those of you using Cygwin (DLL version 1.7.17-1) and Redis version 2.6.9, I hope to share my experience with you so that you can save some time.

First, make sure that you have the “make” and “gcc” Cygwin packages installed. Then, open up a Cygwin terminal window and then download and extract Redis using the following commands:

1
2
3
4
$ wget http:
//redis
.googlecode.com
/files/redis-2
.6.9.
tar
.gz
$
tar
xzf redis-2.6.9.
tar
.gz
$
cd
redis-2.6.9
$
cd
src

Then, within the src directory, add the following to the redis.h file:

1
2
3
4
5
6
7
8
9
#ifdef __CYGWIN__
#ifndef SA_ONSTACK
#define SA_ONSTACK 0x08000000
#endif
#endif
  
#if defined(__CYGWIN__)
#define strtold(a,b)    ((long double)strtod((a),(b)))
#endif

I added the code above right before the “Data types” comment (Before line 312). The first five lines resolve the`SA_ONSTACK' undeclared error originally identified . If you were to run make with this solution only, you would bump into the next error: undefined reference to `_strtold'. The last three lines address this error.

Ignoring warnings, make will generate the following executables in the src directory:

  • redis-benchmark.exe
  • redis-check-aof.exe
  • redis-check-dump.exe
  • redis-cli.exe
  • redis-sentinel.exe
  • redis-server.exe

Copy these files into Cygwin’s bin directory. To quickly test that Redis works, type in redis-server to start Redis with default options. In another Cygwin terminal window, start the Redis command line interface by typing redis-cli. At the prompt, simply type “ping“. If Redis is up and running, it should simply reply with “PONG“.

Enjoy!

http://blog.joshuawhite.com/open-source/building-redis-for-use-on-cygwin/

转载地址:http://zkfkm.baihongyu.com/

你可能感兴趣的文章
Linux内核升级
查看>>
java枚举常用配置
查看>>
本人的性格弱点
查看>>
C#实现一维小波变换
查看>>
PHP内核定义变量的方式
查看>>
hadoop零散笔记
查看>>
uboot移植——uboot启动回顾
查看>>
分段机制和分页机制
查看>>
三天学会HTML5 之第一天
查看>>
学习《计算机网络》思路总结
查看>>
Jquery对象与DOM对象的转换
查看>>
IM设计思考:点对点消息交换
查看>>
Java 线程池框架核心代码分析
查看>>
Xpath语法
查看>>
接地气又好用,8 款优秀的国产开源博客系统推荐
查看>>
pg_class的reltablespace字段含义
查看>>
unity简介
查看>>
nginx中try_files参数易被忽略的知识点
查看>>
添加10个用户user1到user10,但要求只有用户不存在的情况下才能添加
查看>>
ES6学习经验
查看>>