slint-ui/slint · error

Unable to generate bindings

Error message

Unable to generate bindings

What it means

Error "Unable to generate bindings" thrown in slint-ui/slint.

Source

Thrown at api/cpp/cbindgen.rs:1064

        using types::IntRect;
        using types::Size;
        using types::MouseEvent;

        template<typename T> struct Option;
        // This specialization provides a concrete C++ type for Option types
        template<typename T>
        struct Option<T *> {
            T *ptr = nullptr;
            Option() noexcept = default;
            Option(T *p) noexcept : ptr(p) {}
        };
    }
    template<typename ModelData> class Model;
}",
        )
        .with_trailer(gen_item_declarations(&items))
        .generate()
        .expect("Unable to generate bindings")
        .write_to_file(include_dir.join("slint_internal.h"));

    Ok(())
}

fn gen_backend_qt(
    root_dir: &Path,
    include_dir: &Path,
    dependencies: &mut Vec<PathBuf>,
) -> anyhow::Result<()> {
    let mut config = default_config();

    let items = [
        "NativeButton",
        "NativeSpinBox",
        "NativeCheckBox",
        "NativeSlider",
        "NativeProgressIndicator",

View on GitHub (pinned to 3fd8f2ec03)

Solutions

  1. Check the cbindgen configuration and fix any items it cannot process.
  2. Ensure all referenced types are visible to cbindgen.

When it happens

Trigger: Thrown at api/cpp/cbindgen.rs:1064 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slint-ui/slint@3fd8f2ec03 (2026-08-19). Data as JSON: /api/errors/600900d9f5f0144d. Report an issue: GitHub.