Linker error: undefined reference to `EVP_cast5_ecb' - android

I'm trying to compile openssl with cast support but I instead get this error:
SharedLibrary : libcrypto.so
./obj/local/armeabi/objs/crypto/evp/c_allc.o: In function `OpenSSL_add_all_ciphers':
~/testandroid/libssl/jni/crypto/evp/c_allc.c:143: undefined reference to `EVP_cast5_ecb'
~/testandroid/libssl/jni/crypto/evp/c_allc.c:144: undefined reference to `EVP_cast5_cfb64'
~/testandroid/libssl/jni/crypto/evp/c_allc.c:145: undefined reference to `EVP_cast5_ofb'
~/testandroid/libssl/jni/crypto/evp/c_allc.c:146: undefined reference to `EVP_cast5_cbc'
./obj/local/armeabi/objs/crypto/evp/e_old.o: In function `EVP_cast5_cfb':
~/testandroid/libssl/jni/crypto/evp/e_old.c:104: undefined reference to `EVP_cast5_cfb64'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libcrypto.so] Error 1
EVP_cast5_ecb and friends are all defined in ~/testandroid/libssl/jni/crypto/evp/evp.h and in ~/testandroid/libssl/jni/include/evp.h
#ifndef OPENSSL_NO_CAST
const EVP_CIPHER *EVP_cast5_ecb(void);
const EVP_CIPHER *EVP_cast5_cbc(void);
const EVP_CIPHER *EVP_cast5_cfb64(void);
# define EVP_cast5_cfb EVP_cast5_cfb64
const EVP_CIPHER *EVP_cast5_ofb(void);
#endif
In crypto/Android.mk
local_src_files := \
evp/c_allc.c \
evp/e_old.c \
# And a whole bunch of other c files
local_c_includes := \
$(APP_PROJECT_PATH) \
$(APP_PROJECT_PATH)/crypto/asn1 \
$(APP_PROJECT_PATH)/crypto/evp \ # evp.h is located here
$(APP_PROJECT_PATH)/include \
$(APP_PROJECT_PATH)/include/openssl # Another evp.h is also located here
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../android-config.mk
ifeq ($(TARGET_ARCH),arm)
LOCAL_NDK_VERSION := 5
LOCAL_SDK_VERSION := 9
# Use the NDK prebuilt libz and libdl.
LOCAL_LDFLAGS += -lz -ldl
else
LOCAL_SHARED_LIBRARIES += libz libdl
endif
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_CFLAGS += $(local_c_flags)
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libcrypto
include $(BUILD_SHARED_LIBRARY)
I'm probably missing something very trivial here, since I'm new to Android and C in general, so be nice :)
EDIT: I saw that there is a Makefile for cast. I'm guessing there is a whole load of linking magic going on at the very bottom of the original Makefile. How would I do something equivalent for Android?
#
# OpenSSL/crypto/cast/Makefile
#
DIR= cast
TOP= ../..
CC= cc
CPP= $(CC) -E
INCLUDES=
CFLAG=-g
MAKEFILE= Makefile
AR= ar r
CAST_ENC=c_enc.o
CFLAGS= $(INCLUDES) $(CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
GENERAL=Makefile
TEST=casttest.c
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC=c_skey.c c_ecb.c c_enc.c c_cfb64.c c_ofb64.c
LIBOBJ=c_skey.o c_ecb.o $(CAST_ENC) c_cfb64.o c_ofb64.o
SRC= $(LIBSRC)
EXHEADER= cast.h
HEADER= cast_s.h cast_lcl.h $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER)
top:
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
all: lib
lib: $(LIBOBJ)
$(AR) $(LIB) $(LIBOBJ)
$(RANLIB) $(LIB) || echo Never mind.
#touch lib
cast-586.s: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
$(PERL) asm/cast-586.pl $(PERLASM_SCHEME) $(CLAGS) $(PROCESSOR) > $#
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
links:
#$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
#$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
#$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
install:
#[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
#headerlist="$(EXHEADER)"; for i in $$headerlist ; \
do \
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done;
tags:
ctags $(SRC)
tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
#[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
clean:
rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
c_cfb64.o: ../../e_os.h ../../include/openssl/cast.h
c_cfb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
c_cfb64.o: c_cfb64.c cast_lcl.h
c_ecb.o: ../../e_os.h ../../include/openssl/cast.h
c_ecb.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
c_ecb.o: ../../include/openssl/opensslv.h c_ecb.c cast_lcl.h
c_enc.o: ../../e_os.h ../../include/openssl/cast.h
c_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
c_enc.o: c_enc.c cast_lcl.h
c_ofb64.o: ../../e_os.h ../../include/openssl/cast.h
c_ofb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
c_ofb64.o: c_ofb64.c cast_lcl.h
c_skey.o: ../../e_os.h ../../include/openssl/cast.h
c_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
c_skey.o: c_skey.c cast_lcl.h cast_s.h

Related

Library created with debug info when set release flags

This is my shell command:
cmake . \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_TOOLCHAIN_FILE=$toolchain \
-DANDROID_NDK=$ndk_path \
-DANDROID_TOOLCHAIN=clang \
-DANDROID_ABI=$arc_abi \
-DANDROID_PLATFORM=android-21 \
-DCMAKE_BUILD_TYPE=Release \
-DANDROID_STL=c++_static
make
and in CMakeLists:
cmake_minimum_required( VERSION 3.5.1 )
project(husky)
set(prelibs "${CMAKE_SOURCE_DIR}/../../../../third_party/libs")
set(third_include "${CMAKE_SOURCE_DIR}/../../../../third_party/include")
set(src_root "${CMAKE_SOURCE_DIR}/../../../../src")
message(STATUS "cur dir:${CMAKE_CURRENT_SOURCE_DIR}")
string(REPLACE "-Oz" "-O3" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
string(REPLACE "-Os" "-O3" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread -O3 -Wnon-virtual-dtor -Wno-unused-parameter")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wextra -flto -fuse-ld=gold -Wl")
set( CMAKE_BUILD_TYPE Release )
...
...
add_library(my_test
SHARED
${ALGO_SRC_LIST}
${API_SRC_LIST}
${STAGE_SRC_LIST}
${UTILS_SRC_LIST}
${UTILS_CPU_LIST}
${UTILS_FORMAT_LIST}
${PIPELINE_SRC_LIST}
)
target_link_libraries(my_test
libopencv_imgproc
libopencv_core
libcpufeatures
video
libtbb
libalgo
libprotobuf
${EXTRA_LIBS}
)
Whether I set CMAKE_BUILD_TYPE or not, build library always has debuginfo. What's wrong with it?
update: my target is a dynamic library. when add "set( CMAKE_BUILD_TYPE Release )" in CMakeLists.txt or add "-DCMAKE_BUILD_TYPE=Release" in cmake command, result is always a debug library。

failed to compile opus on android

I would like to compile opus on android for one project.
I use a Android.mk to compile it.
It looks like that:
ROOT := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PATH := $(ROOT)/opus-1.1
LOCAL_MODULE := libopus
LOCAL_SRC_FILES := celt/bands.c celt/celt.c celt/celt_decoder.c celt/celt_lpc.c celt/cwrs.c \
celt/entcode.c celt/entdec.c celt/entenc.c celt/kiss_fft.c \
celt/laplace.c celt/mathops.c celt/mdct.c celt/modes.c \
celt/pitch.c celt/quant_bands.c celt/rate.c celt/vq.c \
silk/A2NLSF.c silk/ana_filt_bank_1.c silk/biquad_alt.c \
silk/bwexpander_32.c silk/bwexpander.c \
silk/check_control_input.c silk/CNG.c silk/code_signs.c \
silk/control_audio_bandwidth.c silk/control_codec.c \
silk/control_SNR.c silk/debug.c silk/dec_API.c \
silk/decode_core.c silk/decode_frame.c silk/decode_indices.c \
silk/decode_parameters.c silk/decode_pitch.c \
silk/decode_pulses.c silk/decoder_set_fs.c silk/enc_API.c \
silk/encode_indices.c silk/encode_pulses.c silk/gain_quant.c \
silk/HP_variable_cutoff.c silk/init_decoder.c \
silk/init_encoder.c silk/inner_prod_aligned.c \
silk/interpolate.c silk/lin2log.c silk/log2lin.c \
silk/LPC_analysis_filter.c silk/LPC_inv_pred_gain.c \
silk/LP_variable_cutoff.c silk/NLSF2A.c silk/NLSF_decode.c \
silk/NLSF_del_dec_quant.c silk/NLSF_encode.c \
silk/NLSF_stabilize.c silk/NLSF_unpack.c silk/NLSF_VQ.c \
silk/NLSF_VQ_weights_laroia.c silk/NSQ.c silk/NSQ_del_dec.c \
silk/pitch_est_tables.c silk/PLC.c silk/process_NLSFs.c \
silk/quant_LTP_gains.c silk/resampler.c \
silk/resampler_down2_3.c silk/resampler_down2.c \
silk/resampler_private_AR2.c \
silk/resampler_private_down_FIR.c \
silk/resampler_private_IIR_FIR.c \
silk/resampler_private_up2_HQ.c silk/resampler_rom.c \
silk/shell_coder.c silk/sigm_Q15.c silk/sort.c \
silk/stereo_decode_pred.c silk/stereo_encode_pred.c \
silk/stereo_find_predictor.c silk/stereo_LR_to_MS.c \
silk/stereo_MS_to_LR.c silk/stereo_quant_pred.c \
silk/sum_sqr_shift.c silk/table_LSF_cos.c \
silk/tables_gain.c silk/tables_LTP.c \
silk/tables_NLSF_CB_NB_MB.c silk/tables_NLSF_CB_WB.c \
silk/tables_other.c silk/tables_pitch_lag.c \
silk/tables_pulses_per_block.c silk/VAD.c silk/VQ_WMat_EC.c \
silk/fixed/apply_sine_window_FIX.c silk/fixed/autocorr_FIX.c \
silk/fixed/burg_modified_FIX.c silk/fixed/corrMatrix_FIX.c \
silk/fixed/encode_frame_FIX.c silk/fixed/find_LPC_FIX.c \
silk/fixed/find_LTP_FIX.c silk/fixed/find_pitch_lags_FIX.c \
silk/fixed/find_pred_coefs_FIX.c silk/fixed/k2a_FIX.c \
silk/fixed/k2a_Q16_FIX.c \
silk/fixed/LTP_analysis_filter_FIX.c \
silk/fixed/LTP_scale_ctrl_FIX.c \
silk/fixed/noise_shape_analysis_FIX.c \
silk/fixed/pitch_analysis_core_FIX.c \
silk/fixed/prefilter_FIX.c \
silk/fixed/process_gains_FIX.c \
silk/fixed/regularize_correlations_FIX.c \
silk/fixed/residual_energy16_FIX.c \
silk/fixed/residual_energy_FIX.c \
silk/fixed/schur64_FIX.c silk/fixed/schur_FIX.c \
silk/fixed/solve_LS_FIX.c \
silk/fixed/vector_ops_FIX.c src/opus.c src/opus_compare.c \
src/opus_decoder.c src/opus_encoder.c \
src/opus_multistream.c src/repacketizer.c
LOCAL_CFLAGS := -I$(LOCAL_PATH)/include -I$(LOCAL_PATH)/celt -I$(LOCAL_PATH)/silk -I$(LOCAL_PATH)/silk/fixed -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -O3 -fno-math-errno
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_PATH := $(ROOT)
LOCAL_MODULE := receiver-jni
LOCAL_SRC_FILES := osl_receiver.c spsc_circular_queue.c
LOCAL_CFLAGS := -std=c99
LOCAL_C_INCLUDES:= $(LOCAL_PATH)/opus-1.1/include
LOCAL_LDLIBS := -lOpenSLES -llog -lz -lm
LOCAL_STATIC_LIBRARIES := libopus
include $(BUILD_SHARED_LIBRARY)
It's perfectly compile for mips64, mips, x86_64, x86, arm64-v8a, armeabi-v7a
But when gradle is trying to compile for armeabi, I have an issue.
[armeabi] Compile thumb : opus <= NSQ_del_dec.c
fatal error: error in backend: Cannot select: 0x314f020: i32 = ARMISD::SSAT 0x30e3a30, Constant:i32<15>
0x30e3a30: i32 = sra 0x30e38e0, Constant:i32<1>
0x30e38e0: i32 = add 0x30e0bd0, Constant:i32<1>
0x30e0bd0: i32 = sra 0x3153cf0, Constant:i32<7>
0x3153cf0: i32 = add 0x30b45e0, 0x30b1e50
0x30b45e0: i32 = add 0x30e1110, 0x30e0fc0
0x30e1110: i32 = sra 0x30b24e0, Constant:i32<16>
[...]
In function: silk_noise_shape_quantizer_del_dec
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Android clang version 3.8.275480 (based on LLVM 3.8.275480)
Target: armv5te-none-linux-android
Thread model: posix
InstalledDir: /home/maathor/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/NSQ_del_dec-110b1d.c
clang: note: diagnostic msg: /tmp/NSQ_del_dec-110b1d.sh
clang: note: diagnostic msg:
********************
make: *** [/home/maathor/app/smplayerapp/android/TestImport/app/build/intermediates/ndkBuild/debug/obj/local/armeabi/objs-debug/opus/silk/NSQ_del_dec.o] Error 70
:app:externalNativeBuildDebug FAILED
:app:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
Error while executing process /home/maathor/Android/Sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/maathor/app/smplayerapp/android/TestImport/app/src/main/jni/Android.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=1 APP_PLATFORM=android-15 NDK_OUT=/home/maathor/app/smplayerapp/android/TestImport/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/maathor/app/smplayerapp/android/TestImport/app/build/intermediates/ndkBuild/debug/lib /home/maathor/app/smplayerapp/android/TestImport/app/build/intermediates/ndkBuild/debug/obj/local/armeabi/libreceiver-jni.so}
[armeabi] Compile thumb : receiver-jni <= osl_receiver.c
Do you understand something ? I just would like to build it for my Samsung Galaxy 5 on 6.0.1 !
Thanks for your reply !
ANSWER:
After many tests, it's perfectly work with NDK 13 B (the october 2016 version)
After many tests, it's perfectly work with NDK 13 B (the october 2016 version)

Android NDK & FFMPEG : findLibrary returned null

I am using this to build ffmpeg on ndk:
roman10's android ndk r9d - ffmpeg tutorial
The link shows how to compile, but its not clear how to use it. Can anybody guide me? Thanks.
After ndk-build from my project root i was able to generate .so files inside libs/armeabi and obj/local/armeabi.. Now I am getting findLibrary returned null?? What to do now?
java.lang.UnsatisfiedLinkError: Couldn't load libavutil from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.palak.androidffmpegroman-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.palak.androidffmpegroman-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.palak.androidffmpegroman.MainActivity.<clinit>(MainActivity.java:175)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
my project structure:
My build_android.sh
#!/bin/bash
NDK=$HOME/NDK/android-ndk-r10d
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86
function build_one
{
sudo ./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-doc \
--disable-symver \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
I am using Ndk r10, ffmpeg 2.5.4, ubuntu x86.
Edit: Android.mk
LOCAL_PATH:= /home/palak/NDK/ffmpeg-2.5.4/android/arm
include $(CLEAR_VARS)
LOCAL_MODULE:= libavcodec
LOCAL_SRC_FILES:= lib/libavcodec-56.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE:= libavformat
LOCAL_SRC_FILES:= lib/libavformat-56.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE:= libswscale
LOCAL_SRC_FILES:= lib/libswscale-3.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE:= libavutil
LOCAL_SRC_FILES:= lib/libavutil-54.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE:= libavfilter
LOCAL_SRC_FILES:= lib/libavfilter-5.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE:= libswresample
LOCAL_SRC_FILES:= lib/libswresample-1.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)
Android.mk under jni folder:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := tutorial01
LOCAL_SRC_FILES := tutorial01.c
LOCAL_LDLIBS := -llog -ljnigraphics -lz
LOCAL_SHARED_LIBRARIES := avformat avcodec swscale avutil
include $(BUILD_SHARED_LIBRARY)
$(call import-module,ffmpeg-2.5.4/android/arm)
LOCAL_MODULE:= libavutil
-->
LOCAL_MODULE:= avutil # libavutil.so
example (used to work):
https://github.com/18446744073709551615/reDroid/blob/master/jni/Android.mk
UPDATE:
Once again: you do not need the lib prefixes in library names; LOCAL_MODULE:= avutil will give you libavutil.so
At second, what parameter do you pass to loadLibrary()? Again, it should be "avutil" for libavutil.so.
If you have problems, the best way is to start with the hello-jni example in the NDK (your-ndk-dir/samples/hello-jni/)
/* this is used to load the 'hello-jni' library on application
* startup. The library has already been unpacked into
* /data/data/com.example.hellojni/lib/libhello-jni.so <== !!!!!!!!!!!!!
* at installation time by the package manager.
*/
static {
System.loadLibrary("hello-jni");
}
Once the example compiles and runs, you may add your libraries to it and have your stuff work.
You use name libavutil to refer to libavutil-54.so during ndk-build. This is fine, but the runtime lib is still called libavutil-54.so. Moreover, your other modules, including tutorial01, know it by this name, so renaming it in libs/armeabi will also be wrong.
You need something like
static {
System.loadLibrary("avutil-54");
System.loadLibrary("avcodec-56");
System.loadLibrary("avformat-56");
System.loadLibrary("swscale-3");
System.loadLibrary("tutorial01");
}
In recent version of Android, the system will automatically resolve the local external references, so it's enough to call
static {
System.loadLibrary("tutorial01");
}
Replace your
LOCAL_SHARED_LIBRARIES := avformat avcodec swscale avutil
with
LOCAL_SHARED_LIBRARIES := libavformat libavcodec libswscale libavutil libavfilter libswresample
in Android.mk in your Jni folder.
And Load the libraries like below
static {
System.loadLibrary("avutil-54");
System.loadLibrary("avcodec-56");
System.loadLibrary("avformat-56");
System.loadLibrary("swscale-3");
System.loadLibrary("avfilter-5");
System.loadLibrary("swresample-1");
System.loadLibrary("tutorial01");
}
Are you sure that you are using a phone with an armeabi processor? Add the armeabiv7 in the Application.mk file and it will compile the required files for armeabiv7 phones in the libs folder.
APP_ABI := armeabi armeabi-v7a x86
This should work.

Cannot find libxml2 in android ndk project

Good day Everyone. I have wasted almost a week now figuring what's wrong when i try adding libxml2 to my android ndk project.
LOCAL_PATH := $(call my-dir)
#BUILDING LIBXML2
include $(CLEAR_VARS)
LOCAL_MODULE := xml2
LOCAL_SRC_FILES := $(LOCAL_PATH)/libxml2/libxml2.a
LOCAL_C_INCLUDES := $(LOCAL_PATH)/libxml2/include
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/libxml2/include
LOCAL_DISABLE_FORMAT_STRING_CHECKS := true
include $(BUILD_SHARED_LIBRARY)
#BUILDING SOME SPICE CODES
include $(CLEAR_VARS)
LIB_PATH := $(LOCAL_PATH)/../../libs/armeabi
SPICE_CLIENT_ANDROID_DEPS := $(LOCAL_PATH)/../libs/deps
spice_objs := \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libssl.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libcrypto.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libcelt051.a
LOCAL_MODULE := spice
LOCAL_SRC_FILES := channel-record.c channel-playback.c channel-cursor.c \
spice-cmdline.c coroutine_gthread.c spice-util.c \
spice-session.c spice-channel.c spice-marshal.c spice-glib-enums.c \
common/generated_client_demarshallers.c common/generated_client_demarshallers1.c \
common/generated_client_marshallers.c common/generated_client_marshallers1.c \
gio-coroutine.c channel-base.c channel-main.c spice-proxy.c bio-gsocket.c glib-compat.c \
channel-display.c channel-display-mjpeg.c channel-inputs.c decode-glz.c \
decode-jpeg.c decode-zlib.c wocky-http-proxy.c channel-port.c spice-client.c spice-audio.c \
common/mem.c common/marshaller.c common/canvas_utils.c common/backtrace.c \
common/sw_canvas.c common/pixman_utils.c common/lines.c common/rop3.c common/quic.c \
common/lz.c common/region.c common/ssl_verify.c common/log.c spice-gstaudio.c
LOCAL_LDLIBS += $(spice_objs) \
-ljnigraphics -llog -ldl -lstdc++ -lz -lc \
-malign-double -malign-loops
LOCAL_LDLIBS += -L$(LIB_PATH) -lgstreamer_android
LOCAL_CPPFLAGS += -DG_LOG_DOMAIN=\"GSpice\" \
-DSW_CANVAS_CACHE \
-DSPICE_GTK_LOCALEDIR=\"/usr/local/share/locale\" \
-DHAVE_CONFIG_H -UHAVE_SYS_SHM_H -DSW_CANVAS_CACHE \
-D_REENTRANT -DWITH_GSTAUDIO
LOCAL_C_INCLUDES += $(LOCAL_PATH)/common \
$(SPICE_CLIENT_ANDROID_DEPS)/include
LOCAL_CFLAGS := $(LOCAL_CPPFLAGS) \
-std=gnu99 -Wall -Wno-sign-compare -Wno-deprecated-declarations -Wl,--no-undefined \
-fPIC -DPIC -O3 -funroll-loops -ffast-math
LOCAL_EXPORT_CFLAGS += $(LOCAL_CFLAGS)
LOCAL_EXPORT_LDLIBS += $(LOCAL_LDLIBS)
LOCAL_SHARED_LIBRARIES := gstreamer_android
LOCAL_ARM_MODE := arm
include $(BUILD_STATIC_LIBRARY)
#BUILDING SOME MINE C CODE --------Here i add Mine C file and xml2 for it
include $(CLEAR_VARS)
LOCAL_MODULE := start-spice
LOCAL_SRC_FILES := start-spice.c
LOCAL_SHARED_LIBRARIES= xml2
include $(BUILD_SHARED_LIBRARY)
#BUILDING SPICE ANDROID
include $(CLEAR_VARS)
LOCAL_MODULE := spice-android
LOCAL_SRC_FILES := android/android-service.c android/android-spicy.c android/android-spice-widget.c \
android/android-io.c
LOCAL_STATIC_LIBRARIES := spice
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
ifndef GSTREAMER_SDK_ROOT
ifndef GSTREAMER_SDK_ROOT_ANDROID
$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
endif
GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
endif
GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_SYS) jpeg
GSTREAMER_EXTRA_DEPS := glib-2.0 gthread-2.0 pixman-1 gstreamer-app-0.10
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
So even after I add xml2.so as shared library to my project - nothing happens. It strill cannot find libs and gives me tons of this
[armeabi] SharedLibrary : libstart-spice.so
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function create_request:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:251: error: undefined reference to 'xmlNewDoc'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function create_request:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:252: error: undefined reference to 'xmlNewNode'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function create_request:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:253: error: undefined reference to 'xmlNodeSetContent'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function create_request:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:254: error: undefined reference to 'xmlDocSetRootElement'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function create_request:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:255: error: undefined reference to 'xmlDocDumpFormatMemory'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function create_request:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:256: error: undefined reference to 'xmlFreeDoc'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function Java_com_iiordanov_bVNC_NativeCalls_getPortAndPassword:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:144: error: undefined reference to 'xmlReadMemory'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function Java_com_iiordanov_bVNC_NativeCalls_getPortAndPassword:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:153: error: undefined reference to 'xmlDocGetRootElement'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function Java_com_iiordanov_bVNC_NativeCalls_getPortAndPassword:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:163: error: undefined reference to 'xmlHasProp'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function Java_com_iiordanov_bVNC_NativeCalls_getPortAndPassword:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:170: error: undefined reference to 'xmlHasProp'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function Java_com_iiordanov_bVNC_NativeCalls_getPortAndPassword:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:172: error: undefined reference to 'xmlGetProp'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function Java_com_iiordanov_bVNC_NativeCalls_getPortAndPassword:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:182: error: undefined reference to 'xmlHasProp'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function Java_com_iiordanov_bVNC_NativeCalls_getPortAndPassword:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:184: error: undefined reference to 'xmlGetProp'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function Java_com_iiordanov_bVNC_NativeCalls_getPortAndPassword:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:221: error: undefined reference to 'xmlFreeDoc'
/opt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/objs/start-spice/start-spice.o: in function Java_com_iiordanov_bVNC_NativeCalls_getPortAndPassword:/opt/Test6/bVNC/eclipse_projects/bVNC/jni/src/start-spice.c:234: error: undefined reference to 'xmlFreeDoc'
collect2: ld returned 1 exit status
make: *** [/opt/Test6/bVNC/eclipse_projects/bVNC/obj/local/armeabi/libstart-spice.so] Error 1
С code header in start-spice looks something like this:
#include <jni.h>
#include <android/log.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <libxml/parser.h>
#include <netdb.h>
#include <unistd.h>
#include <errno.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
And i in java code i add:
static
{
System.loadLibrary("start-spice");
}
Would be really really gratefull if someone helped!
If you have the prebuilt static library for Android in $(LOCAL_PATH)/libxml2/libxml2.a, you can use it as is in your spice-android project,
LOCAL_STATIC_LIBRARIES += xml2
Instead of include $(BUILD_SHARED_LIBRARY) for xml2, use
LOCAL_SRC_FILES := libxml2/libxml2.a
include $(PREBUILT_STATIC_LIBRARY)
If you have a strong reason to use xml2 as a separate shared library, you need to add call
System.loadLibrary("xml2");
to your Java code (before loading libspice-android.so) and replace LOCAL_SRC_FILES := $(LOCAL_PATH)/libxml2/libxml2.a with
LOCAL_WHOLE_STATIC_LIBRARIES := $(LOCAL_PATH)/libxml2/libxml2.a
This is issue of linking shared libraries, you need to add LOCAL_LDLIBS += $(LIB_PATH) -lxm2 just before LOCAL_SHARED_LIBRARIES= xml2 .

java.lang.unsatisfiedLinkError lib not found :(failed to link mylib.so)

i've successfully cross compiled a c++ library to the android plateform using the android ndk standalone toolchain.
i've created a new android application project into Eclipse with a jni dolder and Android.mk file and when i do an ndk-build the building goes well and it adds mylib.so to libs/armeabi folder
The problem is when i do a System.loadLibrary("mylibname");
i get the following error in the logcat:
Unable to dlopen(/data/data/com.oussama.firsttry/lib/libdash.so): Cannot load library: link_image[1995]: failed to link libdash.so
that cause a java.lang.UnsatisfiedLinkError: my lib not found**.
There must be a library that my lib depends on and the emulator can't load it so i've done a readelf -d mylib.so and here is the result:
Dynamic section at offset 0x1617c4 contains 26 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libm.so]
0x00000001 (NEEDED) Shared library: [libc.so]
0x00000001 (NEEDED) Shared library: [libdl.so]
0x0000000e (SONAME) Library soname: [libdash.so]
0x00000010 (SYMBOLIC) 0x0
0x0000000f (RPATH) Library rpath: [/home/oussama064/libdash/libdash/../../neededLibs]
0x00000019 (INIT_ARRAY) 0x157268
0x0000001b (INIT_ARRAYSZ) 172 (bytes)
0x0000001a (FINI_ARRAY) 0x157314
0x0000001c (FINI_ARRAYSZ) 8 (bytes)
0x00000004 (HASH) 0xf4
0x00000005 (STRTAB) 0x10f58
0x00000006 (SYMTAB) 0x50b8
0x0000000a (STRSZ) 134112 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000003 (PLTGOT) 0x1618b4
0x00000002 (PLTRELSZ) 1096 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x40dd8
0x00000011 (REL) 0x31b38
0x00000012 (RELSZ) 62112 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x00000018 (BIND_NOW)
0x6ffffffb (FLAGS_1) Flags: NOW
0x6ffffffa (RELCOUNT) 7738
0x00000000 (NULL) 0x0
Here is my Android.mk file:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) LOCAL_MODULE := libcurl LOCAL_SRC_FILES :=
../../../../neededLibs/libcurl.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) LOCAL_MODULE := libxml LOCAL_SRC_FILES :=
../../../../neededLibs/libxml2.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) LOCAL_MODULE := libz LOCAL_SRC_FILES :=
../../../../neededLibs/libz.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) LOCAL_MODULE := m LOCAL_SRC_FILES :=
libm.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS)
LOCAL_MODULE := dl LOCAL_SRC_FILES := libdl.so
include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE
:= c LOCAL_SRC_FILES := libc.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := d LOCAL_SRC_FILES := libdash.so
LOCAL_SHARED_LIBRARIES := c m dl
LOCAL_STATIC_LIBRARIES := libz libxml libcurl include
$(PREBUILT_SHARED_LIBRARY)
i'am really stuck now and i can't figure out what is the missing library
When i do an ndk-build V=1 -B i get the following result:
rm -f /home/oussama064/Android/workspace/FirstTry/libs/armeabi/lib*.so
/home/oussama064/Android/workspace/FirstTry/libs/armeabi-v7a/lib*.so
/home/oussama064/Android/workspace/FirstTry/libs/mips/lib*.so
/home/oussama064/Android/workspace/FirstTry/libs/x86/lib*.so
rm -f /home/oussama064/Android/workspace/FirstTry/libs/armeabi/gdbserver
/home/oussama064/Android/workspace/FirstTry/libs/armeabi-v7a/gdbserver
/home/oussama064/Android/workspace/FirstTry/libs/mips/gdbserver
/home/oussama064/Android/workspace/FirstTry/libs/x86/gdbserver
rm -f /home/oussama064/Android/workspace/FirstTry/libs/armeabi/gdb.setup
/home/oussama064/Android/workspace/FirstTry/libs/armeabi-v7a/gdb.setup
/home/oussama064/Android/workspace/FirstTry/libs/mips/gdb.setup
/home/oussama064/Android/workspace/FirstTry/libs/x86/gdb.setup
make: Circular obj/local/armeabi/libm.so <- obj/local/armeabi/libm.so dependency
dropped.
make: Circular obj/local/armeabi/libm.so <- obj/local/armeabi/libc.so dependency
dropped.
make: Circular obj/local/armeabi/libdl.so <- obj/local/armeabi/libm.so dependency
dropped.
make: Circular obj/local/armeabi/libdl.so <- obj/local/armeabi/libc.so dependency
dropped.
make: Circular obj/local/armeabi/libdl.so <- obj/local/armeabi/libdl.so dependency
dropped.
Prebuilt : libdl.so <= /home/oussama064/Android/workspace/FirstTry/jni/
cp -f /home/oussama064/Android/workspace/FirstTry/jni/libdl.so
obj/local/armeabi/libdl.so
Prebuilt : libm.so <= /home/oussama064/Android/workspace/FirstTry/jni/
cp -f /home/oussama064/Android/workspace/FirstTry/jni/libm.so obj/local/armeabi/libm.so
make: Circular obj/local/armeabi/libc.so <- obj/local/armeabi/libc.so dependency dropped.
Prebuilt : libc.so <= /home/oussama064/Android/workspace/FirstTry/jni/
cp -f /home/oussama064/Android/workspace/FirstTry/jni/libc.so obj/local/armeabi/libc.so
Install : libc.so =>
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libc.so
install -p ./obj/local/armeabi/libc.so
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libc.so
/home/oussama064/NDK/android-ndk-r8d/toolchains/arm-linux-androideabi-
4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libc.so
Prebuilt : libxml2.a <=
/home/oussama064/Android/workspace/FirstTry/jni/../../../../neededLibs/
cp -f
/home/oussama064/Android/workspace/FirstTry/jni/../../../../neededLibs/libxml2.a
obj/local/armeabi/libxml2.a
Prebuilt : libcurl.a <=
/home/oussama064/Android/workspace/FirstTry/jni/../../../../neededLibs/
cp -f
/home/oussama064/Android/workspace/FirstTry/jni/../../../../neededLibs/libcurl.a
obj/local/armeabi/libcurl.a
Prebuilt : libdash.so <= /home/oussama064/Android/workspace/FirstTry/jni/
cp -f /home/oussama064/Android/workspace/FirstTry/jni/libdash.so
obj/local/armeabi/libdash.so
Install : libdash.so =>
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libdash.so
install -p ./obj/local/armeabi/libdash.so
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libdash.so
/home/oussama064/NDK/android-ndk-r8d/toolchains/arm-linux-androideabi-
4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libdash.so
Install : libdl.so =>
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libdl.so
install -p ./obj/local/armeabi/libdl.so
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libdl.so
/home/oussama064/NDK/android-ndk-r8d/toolchains/arm-linux-androideabi-
4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libdl.so
Install : libm.so =>
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libm.so
install -p ./obj/local/armeabi/libm.so
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libm.so
/home/oussama064/NDK/android-ndk-r8d/toolchains/arm-linux-androideabi-
4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded
/home/oussama064/Android/workspace/FirstTry/libs/armeabi/libm.so
I would be thankfull if any one can help me.
You should use the system versions of libm, libc and libdl shared libraries,
LOCAL_LDLIBS := -lm -ldl
If you can't, link them statically.

Categories

Resources