Issue I am trying to use libpng1.6 to load a png from file, but the execution fails with a segmentation fault. I load the library and libpng function called png_image_begin_read_from_file as shown: final dylib = ffi.DynamicLibrary.open( "/opt/homebrew/Cellar/libpng/1.6.37/lib/libpng.dylib"); final dart_function_t png_image_begin_read_from_file
Continue readingTag: dart-ffi
Sending c++ byte data using ffi to flutter
Issue I used this code in this link to take a screenshot of the screen using GdiPlus and convert the bitmap to png bytes. #include <iostream> #include <fstream> #include <vector> #include <Windows.h> #include <gdiplus.h> bool save_png_memory(HBITMAP hbitmap, std::vector<BYTE>& data) {
Continue readingHow to map Dart String with FFI
Issue I’ve the Dart type as: typedef dart_func = String Function(String x); And want to map it with Dart FFi, but their could not find neither String, nor Utf8, I tried typedef ffi_func = ffi.Pointer<Utf8> Function(ffi.Pointer<Utf8> x); But it failed,
Continue readingFlutter C++ bindings with dart::ffi
Issue I am trying to write a wrapper package for a C++ code that does some data analyses in our App. I found this great post that shows the major steps needed to do that. I am more a C/C++
Continue readingFlutter C++ bindings with dart::ffi
Issue I am trying to write a wrapper package for a C++ code that does some data analyses in our App. I found this great post that shows the major steps needed to do that. I am more a C/C++
Continue readingCan I call a C++ constructor function in dart ffi?
Issue I’m new to ffi. But I successfully used dart-ffi with functions call. Now, I’d like to use a C++ object in dart ffi. I don’t know if it is possible, but I tried like this. The prototypes of constructor
Continue readingDifference between writing platform specific code vs dart:ffi code
Issue What is difference between writing code using dart:ffi in flutter or writing code with the method chanel in flutter. Solution dart:ffi is used to call C/C++ code – typically to reuse an existing C/C++ library – often a CPU
Continue readingHow do I Print to Console using dart:ffi in Flutter?
Issue Trying to print to console when running my Flutter app (on Android) from the following C++ code I am running through dart:ffi: #include <iostream> std::cout << “Hello, World!”; Does not give me any output in the terminal. How would
Continue readingHow to convert Uint8List to C equivalent datatype using dart:ffi
Issue I am trying to send an image to my Custom C++ code which I am planning to run using dart:ffi. I have successfully run the hello world problem where I send two integers and get the some of them
Continue readingAccessing assets from C++ plugin through Flutter
Issue I’m trying to use Google Oboe for a 3D audio processing app due to it’s low latency. The app will have a C++ backend, which does the processing, and the frontend is done with Flutter. I’m running a couple
Continue reading