Installation
The ObjectBox C / C ++ database is setup within minutes. Get the library and the generator and start developing high performance data applications.
Last updated
Was this helpful?
The ObjectBox C / C ++ database is setup within minutes. Get the library and the generator and start developing high performance data applications.
Last updated
Was this helpful?
There are a couple of ways to get the ObjectBox library (we recommend CMake 3.14 or newer):
Use to get ObjectBox headers and library ready to use in your project:
If you want to use an ObjectBox Sync variant of the library, change the target_link_libraries
to:
Once you setup the headers and library like this, you can already start using the ObjectBox API! Here's a minimal example to verify your setup:
If you used CMake to setup your project you can already build and execute this program. Otherwise ensure your includes and the runtime shared library (libobjectbox.so, .dylib, .dll depending on the platform) are setup correctly for your compiler and linker environment.
ObjectBox Generator is a tool that will help you with during development of your application (and as opposed to the ObjectBox shared library, it's not supposed to be distributed with your app).
Using the ObjectBox Generator with CMake is straightforward (after the installation via FetchContent
above):
ObjectBox uses FlatBuffers to represent objects at lower levels. It is a highly efficient binary representation that works across platforms. For advanced usage, you can opt to work with FlatBuffers directly.
If you are using the recommended CMake's FetchContent ObjectBox setup, there's no FlatBuffers setup required. You can skip this section.
Get the 's and run it in a terminal:
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-c/main/download.sh)
Get the library for your platform from the latest GitHub release:
You can choose between three different versions per release:core, sync and jni;
As a good starting point for C/C++ Development download "ObjectBox Core" named objectbox-<platform>-<arch>.{tar.gz,zip}
.
Supported Platforms: Linux (x86_64, aarch64, armv7hf, armv6hf), macOS (x64,arm64), Windows (x64,x86) On Windows you might have to install the latest to use the ObjectBox DLL. Support for other platforms and architectures on request (i.e. QNX, armv6)
As an alternative, install the objectbox-generator
executable by downloading the version for your OS from . If you want, add it to $PATH
for convenience. Alternatively, instead of downloading, you can build the generator yourself by cloning this repo and running make
. To build yourself, you need a recent Go version, CMake and a C++11 toolchain.
For more details, please refer to the .
Get the latest and e.g. copy them into your source/include path.
Add the "" directory from our C/C++ GitHub repository as an include path to your project. This is likely not the latest version of FlatBuffers. On the upside it is tested to work with ObjectBox.
Get . You can link your program to the to the static runtime library.