Skip to main content
This page matches SDK 2.0.0. Linux and Windows share the same C++ API in the facebetter namespace (facebetter/*.h).
This guide builds the Facebetter C++ desktop demo on Linux. The demo uses GLFW + Dear ImGui + OpenGL 3: live preview on the left, beauty controls on the right.

Requirements

Ubuntu / Debian

Fedora / RHEL

Step 1: Clone the repository

Step 2: Place the SDK files

Put the Linux SDK under demo/cpp/sdk/:
On desktop, EngineConfig::resource_path must point to the resource.fbd file, not a directory. Example: demo/cpp/sdk/resource/resource.fbd.
SDK packages are on the Download page and in the Dashboard.
To build the SDK from source instead of a prebuilt package:
Output installs under build/linux/release. You can copy include/, lib/libfacebetter.so, and resource.fbd into demo/cpp/sdk/ as above.

Step 3: Configure license

Set app_id / app_key (online v2 auth) or license_token before you run. If license_token is non-empty, it takes priority (license token string, {token} JSON, or offline .lic contents). Details: Auth & License.

Step 4: Build the demo

CMake typically copies resource/resource.fbd (and demo.png if present) into build/resource/.

Step 5: Prepare a preview image (optional)

Step 6: Run

The window shows a live preview and a control panel (skin, 26 face-reshape params, 7 body-reshape params, makeup, filter, sticker, virtual background). Click Reset All to zero intensities.

Troubleshooting

Q: libfacebetter.so: cannot open shared object file
A: Use LD_LIBRARY_PATH=../sdk/lib ./facebetter_demo, copy the .so next to the binary, or add the path with ldconfig.
Q: Engine create returns nullptr / license failed
A: Point resource_path at resource.fbd, and set license_token or valid app_id + app_key. See Auth & License.
Q: CMake cannot find OpenGL
A: Install libgl1-mesa-dev (Ubuntu) or mesa-libGL-devel (Fedora), then re-run CMake.
Q: GLFW: X11: Display variable not set
A: Run inside a graphical session, or set DISPLAY (X11) / WAYLAND_DISPLAY (Wayland).

Next steps

Implement beauty

Create the engine, set effects, and process frames.

API reference

Full C++ API (same as Windows) plus Linux notes.