Flutter异常Couldn‘t find dynamic library in default locations

Flutter项目在Windows系统使用ffigen生成代码时报下面的错误:

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.

#0 findDylibAtDefaultLocations (package:ffigen/src/config_provider/spec_utils.dart:371:3)

#1 Config._getRootConfigSpec.<anonymous closure> (package:ffigen/src/config_provider/config.dart:231:35)

#2 HeterogeneousMapConfigSpec._extractNode (package:ffigen/src/config_provider/config_spec.dart:320:16)

#3 ConfigSpec.extract (package:ffigen/src/config_provider/config_spec.dart:86:12)

#4 new Config.fromYaml (package:ffigen/src/config_provider/config.dart:192:22)

#5 new Config.fromFile (package:ffigen/src/config_provider/config.dart:201:19)

#6 getConfigFromCustomYaml (package:ffigen/src/executables/ffigen.dart:126:17)

#7 getConfig (package:ffigen/src/executables/ffigen.dart:78:14)

#8 main (package:ffigen/src/executables/ffigen.dart:48:14)

参考ffigen文档 ,安装LLVM以及Visual Studio(主要是下载C++),然后在ffigen.yaml文件中配置LLVM路径

复制代码
llvm-path:
  - 'D:\LLVM'
相关推荐
●VON14 小时前
鸿蒙Flutter实战:分类管理页BottomSheet CRUD
数据库·flutter·华为·harmonyos·鸿蒙
woodWu18 小时前
Flutter 复杂拖拽排序实战:同源排序 + 跨容器拖拽完整落地
flutter
小小小小小鹿18 小时前
Vibe Coding 实战:Flutter 自定义路径布局
flutter·vibecoding
程序员老刘21 小时前
Dart 3.12 更新要点:乏善可陈
flutter·ai编程·dart
●VON1 天前
鸿蒙Flutter实战:水平滑动分类标签筛选栏
flutter·华为·harmonyos
●VON1 天前
鸿蒙Flutter实战:24小时新建标签提示组件
android·flutter·华为·harmonyos·鸿蒙
●VON1 天前
鸿蒙Flutter实战:MultiProvider多状态管理架构实践
flutter·华为·架构·harmonyos·鸿蒙
●VON1 天前
鸿蒙Flutter实战:放弃sqflite选纯Dart JSON文件存储
flutter·华为·json·harmonyos·鸿蒙
J船长1 天前
把该死的Provider再讲一遍
flutter