-
Notifications
You must be signed in to change notification settings - Fork 104
Build on Windows
Mira Dytko edited this page Jun 8, 2022
·
1 revision
Use the Aerospike libevent client to write applications to store and retrieve data from an Aerospike database cluster.
The Aerospike libevent client library for Windows requires the following libraries present on the local machine:
Library Name | Description |
---|---|
openSSL | Required for RIPEMD160 hash function. |
pthread | Required for pthread mutex. |
libevent | libevent |
To download and extract the latest 2.0.x libevent library:
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar xvf libevent-2.0.21-stable.tar.gz
To build from the command line:
cd libevent-2.0.X-stable
nmake -f makefile.nmake
To build from Visual C++:
- Select File>New>Project.
- On a general node, pick the Makefile Project template.
- Name = libevent-2.0.X-stable,
- Location = parent directory (libevent-2.0.X-stable).
- Click OK.
- Click Next.
- Type the build command at the command prompt
> nmake -f makefile.nmake
- Build the project.
- Download OpenSSL from here.
- Double-click the exe and follow the installation instructions.
Download pthread, including the lib and dll folders from here
Download the client package from here.
The client package for Windows is:
citrusleaf_client_winlibevent2_{VERSION}.zip
Extract the package contents:
unzip citrusleaf_client_winlibevent2_{VERSION}.zip
This places the package contents in the directory:
citrusleaf_client_winlibevent2_{VERSION}.zip
- Open the visual studio solution file cl_libevent2\window which contains these two projects:
- CitrusleafLibrary — The Aerospike libevent client library files.
- CitrusleafDemo — The demo load application built using the Aerospike libevent client library.
- Start the solution and add all dependencies:
CitrusleafLibrary
- Header files — Edit and add
CitrusleafLibrary -> Properties -> Configuration Properties -> C/C++ -> General -> Additional Include Directories
{path of libevent2_folder}\include
{path of libevent2_folder}\WIN32-Code
{path of openSSL_folder}\include
{path of pthread_folder}\include
- Header files — Edit and add
- Libraries — Edit and add
CitrusleafLibrary -> Properties -> Configuration Properties -> Librarian -> Additional Library Directories
{path of libevent2_folder}
-
{path of pthread_folder}
CitrusleafDemo - Header files — Edit and add
CitrusleafDemo -> Properties -> Configuration Properties -> C/C++ -> General -> Additional Include Directories
{path of libevent2_folder}\include
- Libraries — Edit and add
CitrusleafDemo -> Properties -> Configuration Properties -> Linker -> Additional Library Directories
{path of libevent2_folder}
{path of pthread}\lib\x64
{path of openSSL}\lib
- Build the solution.
Once the CitrusleafDemo
project builds successfully:
- In the CitrusleafDemo.cpp file, set the config parameters (such as namespace, set, hostname, and so on).
- Compile the CitrusleafDemo project and run.