Home > Back-end >  Only on the so libraries, can be in android, ios or using macOS
Only on the so libraries, can be in android, ios or using macOS

Time:09-17


A third-party library provides a dynamic link library and the only *. H header file, win32, win64 and on three versions,
I want to use on macOS and mobile platforms to invoke the Java language, you can do it?

CodePudding user response:

Macos, iOS must not, their dynamic library format is. Dylib (Mach - O object file), and Linux. So (ELF format) is not the same thing,
As for Android, if using the GUI, certainly not, it USES the proprietary graphics environment, and is not based on X-ray and KDE window services, the GNOME desktop environment, such as a GUI, does not necessarily, basic library, on Linux glib is standard parts, but not on Android, usually. So need static linking these libraries,

CodePudding user response:

reference 1st floor DelphiGuy response:
macos, iOS must not, their dynamic library format is. Dylib (Mach - O object file), and Linux. So (ELF format) is not the same thing,
As for Android, if using the GUI, certainly not, it USES the proprietary graphics environment, and is not based on X-ray window service and KDE, GNOME desktop environment, such as a GUI, does not necessarily, basic library, on Linux glib is standard parts, but not on Android, usually. So need static linking these libraries,
, I want to ask, I am using MAC OS, I use GCC to compile a.so file, to load the normal use, but I use the Android the NDK compiled so package (full platform including x86 x86_64) under the MAC can't use, will be submitted to the following error: Java. Lang. UnsatisfiedLinkError:/Users/Tom/codebase/jni/dist/libSample. So: no suitable image found, Did find:/Users/Tom/codebase/jni/dist/libSample. So: unknown file type, the first eight bytes: 0 x7f x46 x4c x45 0 0 0 0 x01 0 x01 0 x01 0 x00, would know what the reason

CodePudding user response:

It has already been said, android. So is the Linux ELF format, macos can't use, you say "I'm using MAC OS, so file when I use the GCC compiler, can use" normal load should be generated is Mach - O format, not the ELF,
  • Related