We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I try write my own C code Then load using this ffi:
// load by manual copy to folder android/src/main/jniLibs final dylib1 = ffi.DynamicLibrary.open("libsimpleso.so");
Then got these error. Did I got problem when use cmake to build .so file
E/flutter ( 4013): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libsimpleso.so': dlopen failed: library "libc.so.6" not found E/flutter ( 4013): #0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43) E/flutter ( 4013): #1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
Code C just simple bellow.
#include <stdio.h> void hello_world_1() { printf("Hello World\n"); } int sum_1(int a, int b) { printf("c called sum\n"); return a + b; }
The text was updated successfully, but these errors were encountered:
#include <stdio.h> void hello_world_1(); int sum_1(int a, int b); int main(void){ int a = 4, b = 5; // call hello wolrd 1 hello_world_1(); // call sum_1 sum_1(a, b); return 0; } void hello_world_1() { printf("Hello World\n"); } int sum_1(int a, int b) { printf("c called sum\n"); return a + b; }
Sorry, something went wrong.
gcc -c -fPIC *.c gcc -shared -o liball.so *.o nm -D liball.so
Thanks but here is my case.
https://github.com/badpaybad/flutter-audio-cutting/tree/main/lib/interop/simpleclang I use cmake to build then copy to android/app/src/main/jniLibs/x86_64/libsimpleso.so in void main
final dylib1 = ffi.DynamicLibrary.open("libsimpleso.so");
I got error above
Other case worked well but need modify android/app/build.gradle
android { externalNativeBuild { cmake { path "../../lib/interop/helloclang/CMakeLists.txt" } }
So I guess that I use cmake to build using CMakeLists.txt was wrong
Could you give me some help?
this is git with source PoC: https://github.com/badpaybad/flutter-audio-cutting
No branches or pull requests
I try write my own C code
Then load using this ffi:
// load by manual copy to folder android/src/main/jniLibs
final dylib1 = ffi.DynamicLibrary.open("libsimpleso.so");
Then got these error. Did I got problem when use cmake to build .so file
E/flutter ( 4013): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libsimpleso.so': dlopen failed: library "libc.so.6" not found
E/flutter ( 4013): #0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
E/flutter ( 4013): #1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
Code C just simple bellow.
The text was updated successfully, but these errors were encountered: