Skip to main content
Skip table of contents

Compiling C++ samples with Conan

To simplify its C++ development, Vivoka works with the Conan package manager. You can find its official documentation here.

Install Conan

Conan requires Python 3, so:

  1. To install Python 3 you can either use your package manager (Linux) or download it (Windows). You may need to add paths to the environment depending on how you install it (look at the advanced options).

  2. Then, use pip install -U "conan<2.0" (install as root on Linux). If you have any trouble, please follow the official tutorial.

If you ever get an error like [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired, that means your version is outdated!

Configure Conan

We have a custom Conan server at Vivoka to deliver our SDK and its dependencies. To configure it you need to register the remote server with the following commands:

BASH
conan profile new default --detect
conan remote add vivoka-customer https://conan-customer.vivoka.com/artifactory/api/conan/vivoka-customer
conan config set general.revisions_enabled=1
conan user <username> -r vivoka-customer -p <password> # Use your VDK login

You can set the password in the CONAN_PASSWORD_VIVOKA_CUSTOMER environment variable if you want to avoid inputting it regularly.

Linux

Most likely Conan will emit a warning about the version of your libstdc++, so run this command:

BASH
conan profile update settings.compiler.libcxx=libstdc++11 default

Windows

VDK 4 offcially supports MSVC 15 and 16 (which maps to Visual Studio 2017 and 2019). To be sure that Conan detected a compatible version, print it:

CODE
conan profile get settings.compiler.version default

While our binaries should be mostly compatible with Visual Studio 2022, it is not supported so use at your own risks!

Install CMake

This is our build system, version >= 3.13 is needed. You can either get it via your Linux package manager or the official installer.

Compilation

Go to the root of the sample and execute these commands:

BASH
# First install the dependencies (do it once)
conan install . -if build

# Build the program
conan build . -bf build

Execute samples

Linux

BASH
source ./build/activate_run.sh # this temporarily exports LD_LIBRARY_PATH for you
./build/bin/<executable>
source ./build/deactivate_run.sh # unexport LD_LIBRARY_PATH

Windows using cmd.exe

BASH
.\build\activate_run.bat
.\build\bin\<executable>.exe
.\build\deactivate_run.bat

Windows using PowerShell

POWERSHELL
.\build\activate_run.ps1
.\build\bin\<executable>.exe
.\build\deactivate_run.ps1

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.