我正在尝试使用NDK-Build
创建2 so文件libkdu_jni.so使用libkdu_v75R.so
我可以完美地创建libkdu_v75R.so但我无法创建libkdu_jni.so
这是我的Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libkdu_v75R
LOCAL_SRC_FILES := kdu_arch.cpp \
kdu_threads.cpp \
mq_encoder.cpp \
mq_decoder.cpp \
block_coding_common.cpp \
block_encoder.cpp \
block_decoder.cpp \
encoder.cpp \
decoder.cpp \
ssse3_coder_local.cpp \
avx_coder_local.cpp \
compressed.cpp \
codestream.cpp \
blocks.cpp \
kernels.cpp \
messaging.cpp \
params.cpp \
colour.cpp \
ssse3_colour_local.cpp \
avx_colour_local.cpp \
avx2_colour_local.cpp \
analysis.cpp \
synthesis.cpp \
multi_transform.cpp \
ssse3_dwt_local.cpp \
avx2_dwt_local.cpp \
roi.cpp \
neon_coder_local.cpp \
neon_colour_local.cpp \
neon_dwt_local.cpp
include $(CLEAR_VARS)
LOCAL_MODULE := libkdu_jni
LOCAL_SRC_FILES := kdu_jni.cpp \
kdu_aux.cpp \
args.cpp \
jp2.cpp \
jpb.cpp \
jpx.cpp \
mj2.cpp \
kdu_tiff.cpp \
kdu_region_decompressor.cpp \
ssse3_region_decompressor.cpp \
kdu_region_compositor.cpp \
kdu_stripe_decompressor.cpp \
kdu_stripe_compressor.cpp \
ssse3_stripe_transfer.cpp \
avx2_stripe_transfer.cpp \
kdu_cache.cpp \
kdcs_comms.cpp \
kdu_client_window.cpp \
kdu_client.cpp \
kdu_clientx.cpp \
kdu_serve.cpp \
kdu_servex.cpp
LOCAL_SHARED_LIBRARIES := libkdu_v75R
include $(BUILD_SHARED_LIBRARY)
错误:
Android NDK: WARNING: APP_PLATFORM android-21 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
[armeabi-v7a] Compile++ thumb: kdu_jni <= args.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= jp2.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= jpb.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= jpx.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= mj2.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_tiff.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_region_decompressor.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= ssse3_region_decompressor.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_region_compositor.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_stripe_decompressor.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_stripe_compressor.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= ssse3_stripe_transfer.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= avx2_stripe_transfer.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_cache.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdcs_comms.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_client_window.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_client.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_clientx.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_serve.cpp
[armeabi-v7a] Compile++ thumb: kdu_jni <= kdu_servex.cpp
[armeabi-v7a] SharedLibrary : libkdu_jni.so
jni/kdu_threads.h:2978: error: undefined reference to 'kdu_core::kdu_thread_queue::~kdu_thread_queue()'
jni/kdu_threads.h:3173: error: undefined reference to 'kdu_core::kdu_thread_queue::schedule_job(kdu_core::kdu_thread_job*, kdu_core::kdu_thread_entity*, bool, int)'
**I CUT THIS PART**
jni/kdu_region_compositor.cpp:2066: error: undefined reference to 'kdu_core::kdu_codestream::set_persistent()'
jni/kdu_region_compositor.cpp:2067: error: undefined reference to 'kdu_core::kdu_codestream::augment_cache_threshold(int)'
jni/kdu_region_compositor.cpp:2089: error: undefined reference to 'kdu_core::kdu_codestream::set_persistent()'
jni/kdu_region_compositor.cpp:2090: error: undefined reference to 'kdu_core::kdu_codestream::augment_cache_threshold(int)'
jni/kdu_region_compositor.cpp:2108: error: undefined reference to 'kdu_core::kdu_codestream::restart(kdu_core::kdu_compressed_source*, kdu_core::kdu_thread_env*)'
jni/kdu_region_compositor.cpp:2139: error: undefined reference to 'kdu_core::kdu_codestream::change_appearance(bool, bool, bool, kdu_core::kdu_thread_env*)'
jni/kdu_region_compositor.cpp:2140: error: undefined reference to 'kdu_core::kdu_codestream::apply_input_restrictions(int, int, int, int, kdu_core::kdu_dims*, kdu_core::kdu_component_access_mode, kdu_core::kdu_thread_env*)'
jni/kdu_region_compositor.cpp:2173: error: undefined reference to 'kdu_core::kdu_thread_env::cs_terminate(kdu_core::kdu_codestream, int*)'
jni/kdu_region_compositor.cpp:2679: error: undefined reference to 'kdu_core::kdu_codestream::set_fast()'
jni/kdu_region_compositor.cpp:2680: error: undefined reference to 'kdu_core::kdu_codestream::set_fussy()'
jni/kdu_region_compositor.cpp:2682: error: undefined reference to 'kdu_core::kdu_codestream::set_resilient(bool)'
jni/kdu_region_compositor.cpp:2778: error: undefined reference to 'kdu_core::kdu_codestream::apply_input_restrictions(int, int, int, int, kdu_core::kdu_dims*, kdu_core::kdu_component_access_mode, kdu_core::kdu_thread_env*)'
jni/kdu_region_compositor.cpp:2781: error: undefined reference to 'kdu_core::kdu_codestream::get_num_components(bool)'
kdu_core::kdu_codestream_comment::get_text()'
collect2.exe: error: ld returned 1 exit status
/cygdrive/c/android-ndk-r10e/build/core/build-binary.mk:664: recipe for target 'obj/local/armeabi-v7a/libkdu_jni.so' failed
make: *** [obj/local/armeabi-v7a/libkdu_jni.so] Error 1
我删除了部分错误,因为它太长了。
我正在尝试创建多个.so文件,首先是v75然后是kdu_jni.so。
因为,kdu_jni使用v75。
我如何修复android.mk。
答案 0 :(得分:0)
我们使用类似下面的东西来构建静态库,使用ndk-build。
include $(CLEAR_VARS)
LOCAL_MODULE := libABC
LOCAL_SRC_FILES := <Path>/libABC.a
include $(PREBUILT_STATIC_LIBRARY)
我不确定这是否适合你。