Skip to main content

Ffigen Troubleshooting

LLVM needs to be installed

The ffigen, a popular Flutter official package used by flutter_rust_bridge, requires the installation of LLVM.

According to its documentation, the commands are:

  1. Install Visual Studio with C++ development support.
  2. Install LLVM or winget install -e --id LLVM.LLVM.

After installation, if the ffigen used by flutter_rust_bridge_codegen still cannot find LLVM, you may specify it explicitly via --llvm-path <YOUR_LLVM_PATH> (command line) or llvm_path: <YOUR_LLVM_PATH> (configuration file).

The generated store_dart_post_cobject() has the wrong signature / 'stdarg.h' file not found in Linux / stdbool.h / ...

Try to run code generator with working directory at /, or set the environment variable:

export CPATH="$(clang -v 2>&1 | grep "Selected GCC installation" | rev | cut -d' ' -f1 | rev)/include"

as described in ffigen #257, or add include path as is described in #108. This is a problem with Rust's builtin Command. See also: #472 & #494.