flutter_programs icon indicating copy to clipboard operation
flutter_programs copied to clipboard

Could you spend time to help me to resolve error in build .so file?

Open badpaybad opened this issue 1 year ago • 3 comments

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;
}

badpaybad avatar Jun 27 '23 04:06 badpaybad