Simply add the library as a git submodule to your project with git submodule add https://github.com/MadLadSquad/UntitledFlipperZero UFZ. Once you run ufbt, an appropriate compile_commands.json file will be generated, which you can use to build your project.

Creating an application

To create an application, do the following:

  1. Install ufbt
  2. Run ufbt create APPID=myapp
  3. Load the .vscode/compile_commands.json file into your IDE
  4. Rename the myapp.c file to myapp.cpp

Setting up the entry point

When you first open myapp.cpp, you're going to be presented with code similar to this:

#include <furi.h>

/* generated by fbt from .png files in images folder */
#include <myapp_icons.h>

int32_t myapp_app(void* p) {
    UNUSED(p);
    FURI_LOG_I("MYAPP", "Hello world");
    FURI_LOG_I("MYAPP", "I'm myapp!");

    return 0;
}

This will not work in C++, however, due to name mangling. To fix it, add it to an extern C block, like this:

#include <furi.h>

/* generated by fbt from .png files in images folder */
#include <myapp_icons.h>

#ifdef __cplusplus
extern "C"
{
#endif
int32_t myapp_app(void* p) {
    UNUSED(p);
    FURI_LOG_I("MYAPP", "Hello world");
    FURI_LOG_I("MYAPP", "I'm myapp!");

    return 0;
}
#ifdef __cplusplus
};
#endif

Now you have a working Flipper Zero application, written in C++.