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'
相关推荐
程序员老刘2 小时前
Flutter版本选择指南:尽早升级3.47.9 | 2026年11月
flutter·ai编程·客户端
恋猫de小郭10 小时前
Android Keep Rules 解读,直接影响 Google Play 上架和曝光
android·前端·flutter
恋猫de小郭2 天前
Flutter A2UI 1.0 ,原来的 genui 也正式换成了这一套 SDK 了
android·前端·flutter
LinXunFeng2 天前
A2UI 1.0 详解:让 AI 生成 Flutter 界面,还不怕它乱写
前端·flutter·agent
好的佩奇2 天前
Dart 之元数据与注解
android·flutter·dart
恋猫de小郭5 天前
Jetpack Compose 1.13 发布,憋了这么久终有交代了
android·前端·flutter
好的佩奇5 天前
蓝牙之设备角色与连接
android·flutter·蓝牙
SoaringHeart6 天前
Flutter最佳实践:用 flutter_html 渲染富文本
前端·flutter
恋猫de小郭7 天前
Flutter 3.50.0 Release 的第一个崩溃,修好了,还没 hotfix
android·前端·flutter
程序员老刘7 天前
跨平台开发地图 | 2026年11月
flutter·ai编程·客户端