Skip to content
imaged
Docs / Setup / C++

C++ setup.

Link against libsdk plus ONNX Runtime, include sdk.hpp, ship.

Prerequisites
Compiler GCC 11+ or Clang 14+, C++20 enabled
CMake 3.20 or later
Platforms Linux x86_64 (CUDA optional), macOS arm64, Windows x64 (CUDA optional)
License token JWT issued from /dashboard
  1. 01

    Download the SDK

    Grab the platform tarball from the downloads page. It carries libsdk, the ONNX Runtime build the SDK was linked against, and the public headers under include/.

    bash
    tar -xzf imaged-linux-x86_64-0.10.tar.gz
    # or on macOS:
    tar -xzf imaged-macos-arm64-0.10.0.tar.gz
    # or on Windows (PowerShell, CPU build):
    Expand-Archive imaged-sdk-v0.10-windows-x64-cpu.zip .
    
    cd imaged-sdk-0.10
  2. 02

    Wire up CMake

    Point your project at the include/ directory and link against libsdk plus libonnxruntime. Both live next to the headers in the tarball.

    cmake
    cmake_minimum_required(VERSION 3.20)
    project(hello_imaged CXX)
    
    set(CMAKE_CXX_STANDARD 20)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    set(IMAGED_DIR ${CMAKE_SOURCE_DIR}/imaged-sdk-0.10)
    
    add_executable(hello_imaged main.cpp)
    
    target_include_directories(hello_imaged PRIVATE ${IMAGED_DIR}/include)
    target_link_directories(hello_imaged PRIVATE ${IMAGED_DIR}/lib)
    target_link_libraries(hello_imaged PRIVATE sdk onnxruntime)
    
    set_target_properties(hello_imaged PROPERTIES
        BUILD_RPATH ${IMAGED_DIR}/lib
        INSTALL_RPATH ${IMAGED_DIR}/lib)
  3. 03

    Hello world

    Open the SDK, paste a license token from /dashboard, verify the signature, print the version. The token is a JWT issued for one audience (your build identifier).

    cpp
    #include "imaged/sdk.hpp"
    
    #include <iostream>
    
    int main() {
        imaged::SDK::AI ai;
        auto& config = ai.getOptions();
        config.set("license.token", "your-license-token");
        config.set("license.audience", "cameras.acme.com");
    
        int status = config.checkLicense();
        if (status != imaged::SDK::ConfigurationOptions::SUCCESS) {
            std::cerr << "license check failed, status " << status << "\n";
            return 1;
        }
    
        std::cout << "imaged " << ai.getVersion()
                  << " licensed=" << ai.isLicensed() << "\n";
        return 0;
    }
  4. 04

    Build and run

    Configure once, build, run. The SDK reads no environment variables and writes nothing to disk during a license check.

    bash
    cmake -S . -B build
    cmake --build build -j
    
    ./build/hello_imaged
    # imaged 0.10.0 licensed=1
  5. 05

    Pick a provider

    Inference runs on CPU by default. Switch with one config key per family. CoreML on Apple Silicon, CUDA on Linux with NVIDIA. Numbers per model live on each model card.

    cpp
    config.set("yolo.inference.provider", "coreml");  // or "cuda", "cpu"
  6. 06

    Where to go next

    The C++ object detection page walks through loading YOLO26x and reading the bounding boxes back. Every other family follows the same load, run, read pattern.