Skip to main content

Return Value Convention

Most SDK methods return int: BeautyEffectEngine::Create() returns a std::shared_ptr; it returns nullptr on failure.

Common Errors and Fixes

1. Engine Creation Fails (Create Returns nullptr)

Possible causes:
  • Invalid or inactive app_id / app_key
  • resource.fbd file not found at resource_path
  • facebetter.dll missing or version mismatch
  • No network access (online authentication failed)
How to diagnose:
Common fixes:
  1. Use an absolute path to rule out relative path issues:
  2. Make sure facebetter.dll is in the same directory as the executable (CMake copies it automatically after build).
  3. Get fresh app_id and app_key from the dashboard.

2. facebetter.dll Not Found at Runtime

Symptom: A Windows dialog reports “facebetter.dll was not found” on startup. Fix:
Or re-run cmake --build build — CMake automatically copies the DLL after every build.

3. ProcessImage Returns nullptr

Possible causes:
  • Input ImageFrame is null (file not found, unsupported format, etc.)
  • Engine was not initialized successfully
  • Out of memory
How to handle:

4. Beauty Effects Have No Visible Impact

Possible causes:
  • The relevant BeautyType was not enabled via SetBeautyTypeEnabled
  • Parameter value is 0 (effect is off)
  • No face detected in the frame (reshape/makeup require face detection to succeed)
Checklist:

5. SetBeautyParam Returns Non-Zero

Possible causes:
  • engine is nullptr (engine creation failed earlier)
  • Value out of range [0.0, 1.0]
How to handle:

6. OpenGL / Display Issues

Possible causes:
  • GLFW initialization failed (driver issue or OpenGL 3.0+ not available)
  • gladLoadGLLoader returned false
How to diagnose:
Make sure your GPU driver is up to date. Hardware OpenGL is usually unavailable in virtual machines or Remote Desktop sessions.

Enabling Debug Logs

During development, enable Debug-level logging for maximum detail:
The log file is written to the same directory as the executable.

Error Code Reference