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 here. 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/

Building Redis for use on Cygwin(转)的更多相关文章

  1. Redis(三)源source编译

    背景: 自己电脑是win7 32bit的,而想要Redis4.0的版本,但是在网上没找到,所以自己干脆download源source,自己build,安装. 最后,目前达到的状态是,windows下s ...

  2. centos7安装redis

    方法一:使用命令安装(前提是已经安装了EPEL). 安装redis: yum -y install redis 启动/停止/重启 Redis 启动服务: 1 systemctl start redis ...

  3. Python之路【第十篇】Python操作Memcache、Redis、RabbitMQ、SQLAlchemy、

    Memcached Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态.数据库驱动网站的速度 ...

  4. Redis-cluster集群【第一篇】:redis安装及redis数据类型

    Redis介绍: 一.介绍 redis 是一个开源的.使用C语言编写的.支持网络交互的.可以基于内存也可以持久化的Key-Value数据库. redis的源码非常简单,只要有时间看看谭浩强的C语言,在 ...

  5. 在CentOS下安装Redis

    Redis比较傲娇,在windows上还没有很好的安装方式,不得已搞了个虚拟机玩玩. 装Redis十分简单,按照下面的几个命令来就行了. 安装命令 wget http://download.redis ...

  6. redis 在windows 上的安装与使用

    1.redis-windows 最近在做一个抢拍模块,由于过于平凡的insert与update I/O受不了,故只好把东西放内存里,等拍卖结束了,在写入磁盘. 至于为什么要用window呢? 因为服务 ...

  7. windows下和linux下 Redis 安装

    Redis 是一个高性能的key-value数据库, 使用内存作为主存储,数据访问速度非常快,当然它也提供了两种机制支持数据持久化存储.比较遗憾的是,Redis项目不直接支持Windows,Windo ...

  8. centos 6.8安装redis

    1. 下载到redis下载页面https://redis.io/download下载对应版本的reids安装包,如:redis-${version}.tar.gz . 2. 安装redis的详细安装步 ...

  9. redis编译问题

    在编译redis时,出现以下问题 In file included from adlist.c:34:0: zmalloc.h:50:31: fatal error: jemalloc/jemallo ...

随机推荐

  1. 全部编程皆为Web编程

    原文作者:Jeff Atwood   原文链接:http://blog.codinghorror.com/all-programming-is-web-programming Michael Brau ...

  2. Django操作model时刻,一个错误:AttributeError:’ProgrammingError’ object has no attribute ‘__traceback__’

    原因:在Django项目下对应的应用以下的models.py配置的model(也就是class)没有创建成对应的表. 这是怎么回事呢? 首先,将models.py里面的model创建成相应的数据库表的 ...

  3. 基于最简单的FFmpeg采样读取内存读写:存储转

    ===================================================== 基于最简单的FFmpeg样品系列读写内存列表: 最简单的基于FFmpeg的内存读写的样例:内 ...

  4. HD2 Tmobile 重新分区代码(使用clk 1.6.5 de)

    fastboot oem part-resize misc: fastboot oem part-resize recovery: fastboot oem part-resize boot: fas ...

  5. Hdu-1565 电网接入(1) (国家压缩dp获得冠军

    正方形格通路(1) Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  6. 【Linux探索之旅】第二部分第一课:终端Terminal,好戏上场

    内容简介 1.第二部分第一课:终端Terminal,好戏上场 2.第二部分第二课预告:命令行,世界尽在掌握 终端Terminal,好戏上场 随着第一部分的结束,我们进入了第二部分(小编你这好像是废话. ...

  7. SQL SERVER2005事务日志已满 解决方法

    DUMP TRANSACTION 数据库名称 WITH NO_LOG alter database 数据库名称 set recovery simple 3.右键你要压缩的数据库--所有任务--收缩数据 ...

  8. Javascript作用域问题的构造函数的变量

    构造函数new对于使用.代表创建对象.此外,它可以被用作普通的函数调用,因为它也是一个功能. function Person(name) { this.name=name; } Person(12); ...

  9. FastDFS设备、构造、配置()一-安装和部署

    FastDFS是一个开源的.高性能的的分布式文件系统,他基本的功能包含:文件存储.同步和訪问,设计基于高可用和负载均衡,FastDFS很适用于基于文件服务的站点.比如图片分享和视频分享站点 FastD ...

  10. 对SA权限的再突破 (对付xplog70.dll被删)转载

    原文:对SA权限的再突破 (对付xplog70.dll被删)转载 对SA权限的再突破 (对付xplog70.dll被删)转载 转载自:http://www.bitscn.com/plus/view.p ...