I am trying to generate bindings for libtorrent using ffigen.
The output of dart run ffigen --config ffigen.yaml
is something like this
Input Headers: [src2/include/libtorrent/libtorrent.hpp]
[SEVERE] : Header src2/include/libtorrent/libtorrent.hpp: Total errors/warnings: 1.
[SEVERE] : src2/include/libtorrent/libtorrent.hpp:4:10: fatal error: 'libtorrent/add_torrent_params.hpp' file not found [Lexical or Preprocessor Issue]
Finished, Bindings generated in /.../flutter/projects/dart_libtorrent/lib/bindings_generated.dart
This is my ffigen.yaml
file
# Run with `dart run ffigen --config ffigen.yaml`.
name: DartLibTorrentBindings
description: |
Bindings for `LibTorrent`.
Regenerate bindings with `dart run ffigen --config ffigen.yaml`.
output: "lib/bindings_generated.dart"
headers:
entry-points:
- "src2/include/libtorrent/libtorrent.hpp"
preamble: |
// ignore_for_file: always_specify_types
// ignore_for_file: camel_case_types
// ignore_for_file: non_constant_identifier_names
comments:
style: any
length: full
What should I do?
I was following this tutorial:
https://blog.logrocket.com/dart-ffi-native-libraries-flutter/