flutter pub run ffigen 错误如下。
PS D:\dev\project\git\shadowscore> flutter pub run ffigen --config ffigen.yaml
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Deprecated. Use `dart run` instead.
Building package executable... (3.3s)
Built ffigen:ffigen.
Running in Directory: 'D:\dev\project\git\shadowscore'
[SEVERE] : Couldn't find dynamic library in default locations.
[SEVERE] : Please supply one or more path/to/llvm in ffigen's config under the key 'llvm-path'.
Unhandled exception:
Exception: Couldn't find dynamic library in default locations.
需要指定LLVM的路径,ffigen.yaml的代码如下:
# Run with `flutter pub run ffigen --config ffigen.yaml`.
name: ShadowscoreBindings
description: |
Bindings for `src/shadowscore.h`.
Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`.
output: 'lib/shadowscore_bindings_generated.dart'
headers:
entry-points:
- 'src/shadowscore.h'
include-directives:
- 'src/shadowscore.h'
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
llvm-path: // 这里这里这里
- 'D:\dev\tools\LLVM'