Issue I’m currently facing a challenging issue while working on a Dart application that reads messages over the Zenoh protocol. Here’s a breakdown of my problem: My Dart code executes native C code via Dart:ffi. (without issue) The C code
Continue readingTag: dart-ffi
Dart:ffi – 'must be a subtype' for 'lookupFunction' issue for native code in dart
Issue The type ‘Uint32 Function(IntPtr, Pointer<Uint32>)’ must be a subtype of ‘int Function(IntPtr, Pointer<Uint32>)’ for ‘lookupFunction’. class Psapi { static final ffi.DynamicLibrary psapi = ffi.DynamicLibrary.open(‘psapi.dll’); static int GetWindowThreadProcessId( ffi.IntPtr hwnd, ffi.Pointer<ffi.Uint32> lpdwProcessId) { return psapi.lookupFunction<ffi.Uint32 Function(ffi.IntPtr hwnd, ffi.Pointer<ffi.Uint32> lpdwProcessId), int
Continue readingdart:ffi for NSURLSession
Issue Is it possible to access NSURLSession and related types via FFI from dart? I would like to use this bindings with Flutter on iOS. If yes, could that be done with dart:ffigen and how would I have to configure
Continue readingDart FFI can't load dynamic library on Android
Issue I have a simple C++ function compiled into a dylib file that I’m trying to run on an Android phone. The function is super simple, it just adds to numbers and returns the result. However, I keep getting this
Continue readingHow to get a useful error message when a dart:ffi method fails?
Issue I have a dart method that invokes some C code using dart:ffi. When the C code fails (for example due to some memory violation), I don’t get any error message to indicate what’s wrong, but only the whole process
Continue readingProblem Getting Float Pointer and Int from Native C to Dart
Issue I have a basic FFI call that retrieves a C struct from Dart. Only the char * and int * fields of the struct are returning proper values. The float * and int are returning the wrong values. The
Continue readingConvert a vector of 2D array to dart/flutter for dart-ffi consumption
Issue My c++ function is defined as follows: std::vector<std::array<std::array<float, 160>, 160>> get_masks(float *img_pixels) {…} I would request the community to help out by mapping this function to dart so it can be consumed. I even tried ffigen & Chatgpt but
Continue readingHow to convert dart:ffi Char to String
Issue I have a dart:ffi Struct that contains a pointer to a Char and int len class UnnamedStruct1 extends ffi.Struct { external ffi.Pointer<ffi.Char> ptr; @ffi.Int() external int len; } it is supposed to represent a String (later to parse as
Continue readingHow can I load a C dynamic library for FFI by specifying path in flutter?
Issue I want to load a C Dynamic Library in flutter, how can I specify the path, and open it? is it possible to add .so file to the asset folder? final dynamicLibrary = DynamicLibrary.open(libraryPath); final Pointer<Utf8> Function() _someMethod =
Continue readingHow to Link Lib.a in IOS, static as well as dynamic linking?
Issue I have some open source c++ library , I have converted into lib.a for different IOS architecture, how can I link this library in Xcode For IOS Devices. http://wiki.zeromq.org/build:iphone Reference Link The Main Target is to first test this
Continue reading