You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file documents various errors and their potential fixes related to ffigen.
4
+
5
+
## Errors in source header files
6
+
7
+
Under the hood ffigen uses libclang to parse header files. Any compiler warnings/errors should be logged (with SEVERE level), these should be resolved as it can potentially generate *incomplete* or *invalid* bindings that might cause silent errors at runtime.
8
+
9
+
> You can pass in args to libclang using `compiler-opts` via cmd line or yaml config or both.
10
+
11
+
Here we'll list some common usecases. You can find the full list of [supported args here](https://clang.llvm.org/docs/ClangCommandLineReference.html#id5).
12
+
13
+
### Missing headers
14
+
15
+
These are the most common source file errors. You can specify [include paths to clang](https://clang.llvm.org/docs/ClangCommandLineReference.html#id6) like this
16
+
```yaml
17
+
compiler-opts:
18
+
- "-I/path/to/folder"
19
+
```
20
+
21
+
### Ignoring source errors
22
+
23
+
As a last resort, you can pass in `--ignore-source-errors` or set `ignore-source-errors: true` in yaml config.
Copy file name to clipboardExpand all lines: pkgs/ffigen/lib/src/header_parser/parser.dart
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ List<Binding> parseToBindings(Config c) {
123
123
_logger.warning("Ignored source errors. (ObjC)");
124
124
} else {
125
125
_logger.severe(
126
-
"Skipped generating bindings due to errors in source files. Either resolve or ignore them (Set --ignore-source-errors on cmd or ignore-source-errors:true in config.");
126
+
"Skipped generating bindings due to errors in source files. See https://github.com/dart-lang/native/blob/main/pkgs/ffigen/errors.md.");
0 commit comments