A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mongodb.com/docs/atlas/device-sdks/sdk/cpp/install/ below:

Install the C++ SDK - Atlas Device SDKs

Atlas Device SDK for C++ enables client applications written in C++ to access data stored on devices and sync data with Atlas. This page details how to install the C++ SDK in your project and get started.

Tip Atlas Device SDK and Realm

The SDK uses Realm Core database for device data persistence. When you install the C++ SDK, the package names reflect Realm naming.

When developing with Xcode, you can use Swift Package Manager (SPM) to install realm-cpp.

In Xcode, select File > Add Packages....

Copy and paste the following into the search/input box.

https://github.com/realm/realm-cpp

Under Package Product, select realm-cpp-sdk. Under Add to Target, select the target you would like to add the SDK to. For example, the target might be the main executable of your app. Click Add Package.

You can use CMake with the FetchContent module to manage the SDK and its dependencies in your C++ project.

Create or modify your CMakeLists.txt in the root directory of your project:

  1. Add Include(FetchContent) to include the FetchContent module in your project build.

  2. Use FetchContent_Declare to locate the SDK dependency and specify the version tag you want to use.

  3. Use the FetchContent_MakeAvailable() command to check whether the named dependencies have been populated, and if not, populate them.

  4. Finally, target_link_libraries() links the SDK dependency to your target executable.

To get the most recent version tag, refer to the releases on GitHub: realm/realm-cpp.

Set the minimum C++ standard to 17 with set(CMAKE_CXX_STANDARD 17).

In a Windows install, add the required compiler flags listed below.

cmake_minimum_required(VERSION 3.15)project(MyDeviceSDKCppProject)# Minimum C++ standardset(CMAKE_CXX_STANDARD 17)# In a Windows install, set these compiler flags:if(MSVC)   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:preprocessor /bigobj")endif()# Include the FetchContent module so you can download the C++ SDKInclude(FetchContent)# Declare the version of the C++ SDK you want to downloadFetchContent_Declare(  cpprealm  GIT_REPOSITORY https://github.com/realm/realm-cpp.git  GIT_TAG        v1.0.0)# The MakeAvailable command ensures the named dependencies have been populatedFetchContent_MakeAvailable(cpprealm)# Create an executable target called myApp with the source file main.cppadd_executable(myApp main.cpp)target_link_libraries(myApp PRIVATE cpprealm)

Run CMake in a gitignored directory, such as build, to generate the build configurations that you can then use to compile your app:

mkdir buildcd buildcmake .. make 

You can use CMake to generate more than simple Makefiles by using the -G flag. See the CMake documentation for more information.

Make the C++ SDK available in your code by including the cpprealm/sdk.hpp header in the translation unit where you want to use it:

#include <cpprealm/sdk.hpp>

The C++ SDK supports building Android apps. To build an Android app:

For an example of how to use the C++ SDK in an Android app, refer to the Android RealmExample App in the realm-cpp GitHub repository.

Specifically, refer to the MainActivity.kt & native-lib.cpp files in the Android example app for code examples.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4