Building Redis for use on Cygwin(转)
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/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
2014-12-14 java代码中获取进程process id(转)
2014-12-14 javaCore分析示例(转)
2014-12-14 java之Thread.sleep(long)与object.wait()/object.wait(long)的区别及相关概念梳理(good)
2014-12-14 一个load飙高的过程分析,非常有价值(转)