skip to Main Content

I am developing a simple application that uses the asynchronous aspects of hiredis, the official C client of Redis. As the first step, I tried to compile the example programs available in the github repo. I am compiling using gcc version 9.3.0 running on Ubuntu 20.04.

The compilation fails with the error message that:

aeEventLoop definition is not found.

I searched for that struct in all the header and code files. But, I could not find such a definition.

Please advise how to resolve this. Thank you!

2

Answers


  1. Chosen as BEST ANSWER

    I found out that it aeEventLoop struct is defined in ae.h, a header file that is a part of the Redis source files. The issue with compiling with the Redis source code is that the Re dis version supported by the distributions (at least the stable versions) is usually much older than the Redis available for download on the Redis site. For instance, Redis 5.0.7 is available on Ubuntu 20.04 LTS; Redis 6.2.4 is available on the Redis site for download. So one needs to download the source code of the older version, if available to complete the compilation.


  2. Hiredis supports many different event libraries such as libevent, libev, glib, qt and a few more. AE is the event library used in Redis (the server) and using it with Hiredis requires some files from Redis, but none of the other event libraries depend on Redis source code. I suggest you try libevent or libev instead.

    Examples using the asynchronous API with different event libraries: https://github.com/redis/hiredis/tree/master/examples

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search