C++ Building Liberator, Linux, Mac, Windows

The C++ API is built using C++17 and depends on Arrow-0.15.1, curl, rapidjson, and cbase64. It is available for Windows 10, MacOS, and Linux.

Requirements

You will need to pass your username and token in as arguments to the functions, add them as environment variables “LIBERATOR_USER” and “LIBERATOR_TOKEN”, or include them in a liberator.json file. Your liberator.json and liberator.pfx files need to be in the same directory as liberator.hpp.

Build for Linux / Mac

Open a terminal with git and conda installed and create a new conda environment.

conda create -n Liberator python=3.6

Run the build_env script.

- bash ./build_env

Run the following to compile with g++.

g++ -std=c++17 -o example -L/<path to your conda env>/lib -I/<path to your conda env>/include -I/<path to your cbase64 folder>/cbase64/include/cbase64 example.cpp -larrow -lcurl -lz

Run the following to execute the example.

LIBERATOR_USER=<Your Username> LIBERATOR_TOKEN=<Your Token> DYLD_LIBRARY_PATH=/usr/lib:<path to your conda env>/lib ./example

 

Build for Windows

Open a PowerShell or terminal emulator such as “Cmder” with git installed and run the Build_Env_Window.bat script. This will build dependencies in 64-bit mode using vcpkg. They will be globally available in Visual Studio 2019. Due to git, the build script must run in a shell and not by double clicking the batch file.

- start Build_Env_Windows.bat

 

Open Visual Studio 2019 project. Right click on project and open project properties. Set to C++17 and add cbase64 header path to Additional Include Directories. Right click on project and add liberator.hpp (and example.cpp if you desire) as an existing item. Any file including liberator.hpp must have “#define NOMINMAX”.