Levi-Lesches / opencv_ffi

An FFI-based implementation of OpenCV in Dart
https://pub.dev/packages/opencv_ffi
Other
17 stars 1 forks source link

Error Failed to load dynamic library 'libopencv_ffi.so' #9

Closed guyluz11 closed 12 months ago

guyluz11 commented 12 months ago

OS: Linux

/home/guyluz/Programs/flutter/bin/cache/dart-sdk/bin/dart --enable-asserts /home/guyluz/Documents/git/opencv_ffi/example/example.dart
Unhandled exception:
Invalid argument(s): Failed to load dynamic library 'libopencv_ffi.so': libopencv_ffi.so: cannot open shared object file: No such file or directory
#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
#2      nativeLib (package:opencv_ffi/src/ffi.dart:21:49)
#3      nativeLib (package:opencv_ffi/src/ffi.dart)
#4      new Camera.fromName (package:opencv_ffi/src/camera.dart:28:31)
#5      main (file:///home/guyluz/Documents/git/opencv_ffi/example/example.dart:6:57)
#6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:296:19)
#7      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

Process finished with exit code 255
Levi-Lesches commented 12 months ago

As mentioned in #4, please add the full path of dist to your computer's LD_LIBRARY_PATH for Dart to find it.

guyluz11 commented 12 months ago

It should be part of the readme.

Thanks it worked

Levi-Lesches commented 11 months ago

It is:

Add the dist folder to your PATH. Restart your terminal/IDE and run your project as normal.

The script will output a command to add the dist folder to your LD_LIBRARY_PATH. You only need to run this command once, even if you modify and rebuild OpenCV, but you must run it again if you move the dist folder.