This example shows how to use the ObjectBox C++ API to create a task-list application using ObjectBox Sync.
Prerequisites are CMake 3.14+ and a C/C++ compiler.
From a terminal, you can build and run the example like this (to only build, remove the --run flag):
./build.sh --run- The
./build.shalso accepts--cleanas the first argument to clear the build directory before building.
If you work with a IDE, you can typically just open each example as a CMake project. The IDE will setup everything for you.
If you prefer to use CMake directly (e.g. on a Windows terminal), you can do so as follows:
cmake -S . -B build
cmake --build build
And then run the built executable:
build/objectbox-examples-... # replace ... with the example name
when you start the application, it will first show a list of available commands. You enter the commands and press enter to execute them.
ls- list all tasksnew <task text>- create a new taskdone <id>- mark a task as doneexit- exit the applicationhelp- prints the available commands
Example: type "new Buy milk" and hit enter to create a new task. Then type "ls" and hit enter to see the new task (and any other open tasks).