| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Sample programs that link against the pre-built IoTDB C++ Session SDK (iotdb_session). Thrift and Boost are not required at application compile time; they are embedded inside the SDK shared library.
All examples connect to a running IoTDB instance (default 127.0.0.1:6667, user root / root).
| Example | Description |
|---|---|
| SessionExample | Tree model: DDL, insert, query, delete |
| AlignedTimeseriesSessionExample | Aligned time series and templates |
| MultiSvrNodeClient | Multi-node insert/query loop |
| tree_example | C Session API (tree model) |
Release CI (client-cpp-package.yml) publishes one zip per platform/toolchain: client-cpp-<version>-<classifier>.zip (zip root contains include/ and lib/).
| Deployment target | Classifier suffix |
|---|---|
| Linux x86_64, glibc ≥ 2.24, CXX11 ABI (recommended) | linux-x86_64-glibc224 |
| Linux aarch64, glibc ≥ 2.24, CXX11 ABI (recommended) | linux-aarch64-glibc224 |
| Linux x86_64, glibc ≥ 2.17, legacy ABI | linux-x86_64-glibc217 |
| Linux aarch64, glibc ≥ 2.17, legacy ABI | linux-aarch64-glibc217 |
| macOS x86_64 | mac-x86_64 |
| macOS arm64 | mac-aarch64 |
| Windows (match your Visual Studio version) | windows-x86_64-vs2017 … vs2026 |
The current build compiles Thrift 0.21 from source at CMake configure time. Legacy -Diotdb-tools-thrift.version=... flags applied to the old pre-built Thrift workflow only. On Linux, prefer glibc224 when your host has glibc ≥ 2.24 and you use the default g++. Use glibc217 only for glibc 2.17 systems or legacy ABI; on Ubuntu 22/24 you may need -D_GLIBCXX_USE_CXX11_ABI=0 when linking against glibc217. See client-cpp README.
The SDK zip produced by client-cpp contains public headers only and one shared library:
client/
├── include/
│ ├── Session.h
│ ├── Export.h
│ └── ... (17 public headers; no thrift/ or boost/)
└── lib/
├── iotdb_session.dll + iotdb_session.lib (Windows)
├── libiotdb_session.so (Linux)
└── libiotdb_session.dylib (macOS)
From the repository root:
mvn clean package -DskipTests -P with-cpp -pl example/client-cpp-example -amMaven unpacks the SDK zip into example/client-cpp-example/target/client/ and runs CMake in target/. Binaries are under target/ (exact path depends on the generator; on Windows with Visual Studio: target/Release/).
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build buildWindows (Visual Studio generator):
cmake -S . -B build -A x64
cmake --build build --config ReleaseEach executable is built with the IoTDB runtime library copied next to the .exe / binary (POST_BUILD step). Linux/macOS binaries use $ORIGIN rpath so they resolve the .so / .dylib in the same directory.
Optional staging folder for deployment:
cmake --build build --target example-dist
# -> build/dist/ contains all example binaries + libiotdb_session.{so,dll,dylib}You only need:
Copy either from build/.../Release/ (Windows) / build/ (Ninja/Make) or from build/dist/ after example-dist.
Files to copy
SessionExample.exe iotdb_session.dll
(Repeat for the other example names if needed.)
Prerequisites on the target PC
Run
.\SessionExample.exeIf you see “The code execution cannot proceed because VCRUNRuntime140.dll was missing”, install the VC++ redistributable above.
You do not need a separate Thrift or Boost runtime; they are inside iotdb_session.dll.
Files to copy
SessionExample libiotdb_session.so chmod +x SessionExample
Prerequisites on the target machine
Check build machine (record in release notes):
ldd --version | head -1
# e.g. ldd (Ubuntu GLIBC 2.35-0ubuntu3) 2.35Check target machine:
ldd --version | head -1
# must be >= build glibc (same major.minor or newer)See which GLIBC_ symbols the binary needs:
objdump -T SessionExample | grep GLIBC_ | sed 's/.*GLIBC_/GLIBC_/' | sort -Vu | tail -5
objdump -T libiotdb_session.so | grep GLIBC_ | sed 's/.*GLIBC_/GLIBC_/' | sort -Vu | tail -5If the target glibc is too old, you'll get errors like version 'GLIBC_2.34' not found at runtime. Rebuild the SDK on an older distro (or in an older container) to widen compatibility.
Run (with .so beside the binary):
./SessionExampleIf the shared library is not found:
export LD_LIBRARY_PATH=.
./SessionExampleNo separate Thrift install is required.
Copy the example binary and libiotdb_session.dylib together. The target macOS version should be ≥ the deployment target used to build the SDK. Check with:
otool -L SessionExampleclient-cpp-example/
├── pom.xml # Maven: unpack SDK + invoke CMake
├── README.md
├── README_zh.md
└── src/
├── CMakeLists.txt
├── SessionExample.cpp
├── AlignedTimeseriesSessionExample.cpp
├── MultiSvrNodeClient.cpp
└── tree_example.c
After mvn package, the runnable tree is under target/ (sources, client/, and CMake build output).
| Back | FazBrowse Home | New Git URL |