Using C + + to call Redis under Windows

Source: Internet
Author: User

No nonsense, Unix under C + + calls Redis can look at this:

http://blog.csdn.net/youngqj/article/details/8266177

The official version of Redis does not provide an interface for VC development, but Microsoft seems to be interested in Redis and has made a full English note here:

https://gist.github.com/MS-Interop/1439660 According to the instructions, a complete set, you can build your own VC version of Redis.

Because the process is more complex, afraid to use and forget later, while remember to write down.

1. First configure git, the detailed content is here: http://www.cnblogs.com/sixbeauty/p/3954223.html

2. Create a new folder (named Redis_build), open cmd, CD in, use Git to get a Antirez/redis backup.

git clone https://github.com/antirez/redis.git

 

3. The next few commands are as good as the shots:

CD Redisgit Checkout 3fac86ff1d
Git checkout-b 2.4_win_uv

4. Download Redis24_win_uv.patch, (in fact, the English description of the bottom one.) ) must be downloaded first to perform successfully.

Pull (Redis24_win_uv.patch) into Redis under the directory redis_bulid that you created earlier, execute:

git am redis24_win_uv.patch

If you have the following warning hints you can ignore:

warning:squelched whitespace errorswarning:215 lines add whitespace errors.

  

5. Continuation of the implementation:

Curl Https://raw.github.com/gist/1439660/d729b823a7ef50ef8ba54393675fb678e740ca4b/redis24_win_uv.patch | git am

By the end of this step, we can get the RedisServer.sln file in the MSVs under the Redis folder.

But it's still useless.

6. Download: Ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe, execute. Build the Pthreads-win32 folder under Redis/deps.

6.1, the pre-built.2 include copy to Pthreads-win32 inside.

6.2, the Pre-built.2 Lib "PthreadVC2.dll" and "PthreadVC2.lib" copied to the Pthreads-win32/lib/debug, and "PthreadVC2.lib" renamed to " Pthread.lib ". (If the release version is copied to pthreads-win32/lib/release)

7. You can now open the RedisServer.sln compilation build.

Reference:

Redis compiles under Windows: http://blog.chinaunix.net/uid-15063109-id-3063848.html

Redis compiles on Windows (Visual c++2010): http://blog.sina.com.cn/s/blog_73c52fda01011c72.html

Using C + + to call Redis under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.