当前位置:网站首页>Redis source code learning-01_ Debugging redis source code in clion
Redis source code learning-01_ Debugging redis source code in clion
2022-06-09 18:07:00 【Galloping dung beetle】
cygwin build
Cygwin It just provides something like Linux Environment , There are still some differences in actual use . But it can meet our basic needs .
download
Official website address :https://cygwin.com/install.html
install
- Choose default

- Select the installation directory , Click next ;

- choice “direct connection( Direct connection )“; If you have an agent , Please select the corresponding setting ;

4. Select the image station to download and install online , Change to domestic image source :http://mirrors.163.com/cygwin/
- In this step , Select the package you want to install ;
Select the package to be installed :gcc-core、gcc-g++、make、gdb、binutils
As shown in the figure

- Click next to start the installation , And wait for the installation , The installation time depends on the network speed and the selected package ;

- Waiting for completion

Clion To configure
In fact, just open Clion It will automatically find Cmake,c Compiler environment for , But you still need to set it manually after finding it , Set the entrance at setting Medium toolchian in 
clone redis Code
Source code address :https://gitee.com/gy297879328/redis_3.0_study
After opening the project , Everyone should pay attention to the above CMakeList.txt, among , We have been configured with several by default target:
among , Libraries should not run independently , We can run the following three , among :
- redis-cli,redis client
- redis-server, Server side
- redis-example, I added this myself , Mainly hope : It can be like java In the , Start a main Method , To test some tools or something , otherwise , You have to write redis-server In the code of , And then use redis-cli To visit , To trigger our test code . It is mainly similar to an entrance for testing .
redis-example, Let me say a little more , If you look carefully, CmakeList.txt, Maybe I understand :
How to debug
take redis-example give an example :
But the debug, There is a problem , It's a separate meeting cmd window , Not directly Console Medium output ;printf There are also some problems .
however , Use run Way to run , There is no problem .
appendix
Can't find cygwin1.dll
Need from window Entrance access , When you double-click it to execute, it will report missing cywin Error of , Here's a temporary solution ,
That is to go to Cygwin Of bin Directory cygwin1.dll, At this point, if you put it in the gang redis-cli The catalog of , You will find Clion Fail to compile ,
The solution is something else To build a execute The catalog of , hold redis-cli and cygwin1 Copy it all in , Then you can start playing happily redis The source 

边栏推荐
- [notes of advanced mathematics] Green formula, Gauss formula, Stokes formula, field theory
- UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xad in position 2: illegal multibyte sequence
- 微信小程序根据经纬度获取省市区信息
- redis源码学习-01_Clion中调试redis源码
- Zhichong launched net zero series energy storage and charging all-in-one machine to create a net zero future with BYD
- 如何让我们的自建站点拥有自定义域名(1)
- crontab定时执行任务
- NLP - Keyword Extraction - textrank
- NLP - 关键词提取 - TextRank
- 详解MySQL索引
猜你喜欢

How to learn the process of KD tree construction and search with cases?

关于并发和并行,Go和Erlang之父都弄错了?

ZigBee组网从未如此简单!

redis源码学习-01_Clion中调试redis源码

ZigBee networking has never been so simple!

Epigentek染色质可及性检测试剂盒原则与程序

Epigentek Hi-Fi cDNA 合成试剂盒说明书

NLP-文本表示-词袋模型和TF-IDF

How to build a real-time development platform to deeply release the value of enterprise real-time data?

谁说Redis不能存大key
随机推荐
阿里10年技术人:Leader的7种思考方式
[work with notes] multiple coexistence of ADB, sound card, network card and serial port of Tina system
电脑小知识与优化
IIS how to open the MD file (how to solve the error when is cannot open the MD file)
Fastjson反序列化远程代码执行漏洞
Fastjson deserialization Remote Code Execution Vulnerability
如何以案例学习kd树构建和搜索过程?
模切产品在不同领域上的应用
C language voter voting function
入駐快訊|歡迎XCHARGE智充科技正式入駐 InfoQ 寫作平臺!
[long time series prediction] detailed explanation of aotoformer code [1] data preprocessing and data reading
Word使用技巧
自动化控制系统中滑环的应用
[notes of advanced mathematics] Green formula, Gauss formula, Stokes formula, field theory
How to realize face verification quickly and accurately?
C language to solve the problem of climbing stairs
君可归烈士寻亲系统开发实战
Vulkan规范笔记(一) 第一章至第六章
What is the expected life of the conductive slip ring
Application of die cutting products in different fields