Library compilation for android arm64

Hi.

So i’m using a C library with an addon, works great on android-arm7.

But i’m trying to make a arm64 android build, which builds, however android studio cannot finalize linking, says :

 error adding symbols: File in wrong format
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

:linkOFAndroidAppArm64-v8aReleaseArm64SharedLibrary FAILED

FAILURE: Build failed with an exception.

The library uses ./configure

I tried to see how oF does arm64 builds, and managed to alter the library’s configure script to add an option to compile armeabiv8a. The library has android support for android mips, eabi, arm7 (which works for me).

For adding the option in the configure script I used:

if test “$target_cpu” = “armeabiv8a”
then
ANDROID_TOOLCHAIN=“arm-linux-androideabi-$ANDROID_GCC_VERSION”
ANDROID_NDK_SYSROOT="$ANDROID_NDK_PLATFORM_PATH/arch-arm"
// ANDROIDBIN="$ANDROID_NDK/toolchains/arm-linux-androideabi-$ANDROID_GCC_VERSION/prebuilt/linux-x86/bin/arm-linux-androideabi"
ANDROIDBIN="$ANDROID_NDK/toolchains/arm-linux-androideabi-$ANDROID_GCC_VERSION/prebuilt/linux-x86_64/bin/arm-linux-androideabi"
CFLAGS="$CFLAGS -fpic -march=armv8-a -O3 -DANDROID --sysroot=$ANDROID_NDK_SYSROOT"
// CFLAGS="$CFLAGS -fpic -march=armv7-a -mfloat-abi=softfp -O3 -DANDROID --sysroot=$ANDROID_NDK_SYSROOT"
// LDFLAGS="$LDFLAGS -Wl,–fix-cortex-a8"
fi

However, this builds the .a files ok, but produces the above error. Any ideas would be most welcome. Thank you.

I have not run into that problem. I’ve been able to build arm64. So I think it is something about your setup or project. Have you tried building a new OF project for arm64 to see if you get the same error or not?

Hi. The issue is with building an external library for arm64 arch. I noticed ofxopenCv does that. I just need to figure out how to pass the right params to the library when configure & make. Not sure if opencv uses configure, probably cmake