samedi 19 septembre 2020

ARM dynamic library compile with incompatible target error

I'm really stuck with this issue when compiling my dynamic library using visual studio 2019 into an ARM ( Android ) ; My library has a GRPC dependency so i must first compile GRPC and Protobuf into an ARM then link them statically into my Library , But when i try to link the libprotobuf.a i get " incompatible target " so please i want to know is this Incompatibly error related to my target selected ANDROID API in this case ( android-18 ) or to the selected Platform Toolset in this case ( Clang 5.0 ) . what i did was compile the GRPC into a static library (*.a) using my Ubuntu machine with an Android NDK standalone-toolchain . Here's my build script :

#!/bin/sh
export GRPC_CROSS_COMPILE=true
export PATH=/home/dev/android-ndk-r16b/build/toolchain/bin:$PATH
export SYSROOT=/home/dev/android-ndk-r16b/build/toolchain/sysroot
export HOST_CC="/usr/bin/gcc"
export HOST_CXX="/usr/bin/g++"
export HOST_LD="/usr/bin/ld"
export CC="arm-linux-androideabi-clang --sysroot $SYSROOT"
export CXX="arm-linux-androideabi-clang++ --sysroot $SYSROOT"
export LD="arm-linux-androideabi-clang++"
export LDXX="arm-linux-androideabi-clang++" 
export AR="arm-linux-androideabi-ar"
export STRIP="arm-linux-androideabi-strip"
export PROTOBUF_CONFIG_OPTS="--host=arm-linux-androideabi --with-sysroot=${SYSROOT} --with-protoc=/usr/local/bin/protoc CFLAGS='-march=armv7-a -D__ANDROID_API__=26' CXXFLAGS='-frtti -fexceptions -march=armv7-a -D__ANDROID_API__=26' LIBS='-llog -lz -lc++_static'"
export HAS_PKG_CONFIG=false
export GRPC_CROSS_LDOPTS="-L$SYSROOT -L/home/dev/grpc"
export GRPC_CROSS_AROPTS="rc --target=elf32-little"

make

And here's the visual studio ( 2019 ) compile log :

enter image description here

Please any GUIDE or HELP in this ?

Aucun commentaire:

Enregistrer un commentaire