From 1f791e06688e55d62fe5b1e46ea858755f62178c Mon Sep 17 00:00:00 2001 From: netroby Date: Thu, 12 Dec 2019 09:04:11 +0000 Subject: [PATCH] Fixed #39679 make sqlite ffi sample run success Closes #39680 https://github.com/dart-lang/sdk/pull/39680 GitOrigin-RevId: 08a6f2c661d645f14ff41c13292002028bc10323 Change-Id: I5100521fa011be5167d00e5610bd87cb2f78093b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127456 Reviewed-by: Daco Harkes Commit-Queue: Daco Harkes --- samples/ffi/sqlite/README.md | 14 ++++++++++++++ samples/ffi/sqlite/pubspec.yaml | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/samples/ffi/sqlite/README.md b/samples/ffi/sqlite/README.md index 4f7c8ebca93..fbd5cb93f4e 100644 --- a/samples/ffi/sqlite/README.md +++ b/samples/ffi/sqlite/README.md @@ -2,6 +2,20 @@ This is an illustrative sample for how to use `dart:ffi`. +## Prerequirement + +For Windows, Linux, and MacOS, you should make sure, sqlite dev lib installed on your system. + +Windows user can download dll from https://www.sqlite.org/download.html + +If you do not have any sqlite3.dll or so file, you may found error message: + +``` +Unhandled exception: +Invalid argument(s): Failed to load dynamic library (126) +#0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:13:55) +#1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12) +``` ## Building and Running this Sample diff --git a/samples/ffi/sqlite/pubspec.yaml b/samples/ffi/sqlite/pubspec.yaml index 04a5fc27c8b..dcc5d40141f 100644 --- a/samples/ffi/sqlite/pubspec.yaml +++ b/samples/ffi/sqlite/pubspec.yaml @@ -6,7 +6,6 @@ author: Daco Harkes , Samir Jindel environment: sdk: '>=2.1.0 <3.0.0' dependencies: - ffi: - path: ../../../third_party/pkg/ffi + ffi: ^0.1.3 dev_dependencies: test: ^1.5.3