The Realm C++ SDK enables client applications written in C++ to access data stored in realms and sync data with Atlas. This page details how to install Realm in your project and get started.
Minimum C++ standard: C++17.
For development on macOS: Xcode 11.x or later.
For development on Windows: Microsoft Visual C++ (MSVC).
Otherwise, we recommend git and CMake.
Make the Realm C++ SDK available in your code by including the
cpprealm/sdk.hpp header in the translation unit where you want to use it:
New in version v0.2.0-preview.
The Realm C++ SDK Preview provides some features in a
namespace. When working with these experimental features, you must
import the experimental header.
And you can access features in the experimental namespace:
using namespace realm::experimental;
The Realm C++ SDK Preview supports building Android apps. To build an Android app:
<uses-permission android:name="android.permission.INTERNET" />to your
Add the subdirectory of the Realm C++ SDK to your native library's
CMakeLists.txtand link it as a target library:
set(CMAKE_CXX_STANDARD 17) add_subdirectory("realm-cpp") ... target_link_libraries( # Specifies the target library. myapplication # make sure to link the Realm C++ SDK. cpprealm )
Ensure that the git submodules are initialized inside of the
realm-cppfolder before building.
When instantiating the Realm or the Realm App, you must pass the
pathparameter in the respective constructor or realm open template.
For an example of how to use the Realm C++ SDK Preview in an Android app, refer to
the Android RealmExample App
realm-cpp GitHub repository.
Specifically, refer to the
in the Android example app for code examples.