编译时的错误如下,求高手解答 "E:\llj_project\android-ndk-r9\ndk-build.cmd" all "Compile thumb : ndkcamera <= com_example_camerandk_NDKCamera.c SharedLibrary : libndkcamera.so Install : libndkcamera.so => libs/armeabi/libndkcamera.so Install : libNetLib.so => libs/armeabi/libNetLib.so E:/llj_project/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip: Unable to recognise the format of the input file `./libs/armeabi/libNetLib.so"" make: *** [libs/armeabi/libNetLib.so] Error 1 make: *** Deleting file `libs/armeabi/libNetLib.so"" android.mk LOCAL_PATH := $(call my-dir) include $(LOCAL_PATH)/prebuild/Androidusc.mk include $(CLEAR_VARS) LOCAL_MODULE := ndkcamera LOCAL_SHARED_LIBRARIES := NetLib LOCAL__ALLOW_UNDEFINED_SYMBOLS :=true LOCAL_C_INCLUDES :=com_example_camerandk_NDKCamera.h LOCAL_SRC_FILES := com_example_camerandk_NDKCamera.c TARGET_ARCH_ABI :=armeabi-v7a include $(BUILD_SHARED_LIBRARY) androidusc.mk #LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := prebuild/NetLib LOCAL_C_INCLUDES :=/prebuild/\ hi_net_dev_errors.h hi_net_dev_sdk.h hi_type.h hi_voice_api.h LOCAL_SRC_FILES := prebuild/libNetLib.so include $(PREBUILT_SHARED_LIBRARY) c文件 #include "com_example_camerandk_NDKCamera.h" #include "./prebuild/hi_net_dev_sdk.h" #include <jni.h> #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <dlfcn.h> JNIEXPORT jint JNICALL Java_com_example_camerandk_NDKCamera_init(JNIEnv* env, jobject thiz) { void *handle = dlopen("./prebuild/lib/libNetLib.so", RTLD_NOW); int i = 0; int (*fun)()=dlsym(handle,"HI_NET_DEV_Init"); i = fun(); dlclose(handle); // i=HI_NET_DEV_Init(); return i; } jni目录结构 |
|
半天都没有高手帮忙
|
|
很显然,你的 libs/armeabi/libNetLib.so 不是自己编译出来的,而是第三方的,请确定这个lib是armeabi 架构编译,你这个很可能是 x86 或其他架构编译出来的
|
|
问了提供者是linux arm
|
|
回复请引用。。。否则是没有提示消息的,他根本就不知道你有回答他(引用2楼的) |
|
没发过帖
|
|
问了提供者是linux arm |
|
LOCAL_SRC_FILES := prebuild/libNetLib.so 去掉.so试一下
|
|
LOCAL_SRC_FILES should point to a file ending with “.so” |
|
50分 |
问他是不是用android-ndk-r9/toolchains/arm-linux-androideabi-4.6 编译器编译的,而且就算他是用的ndk编译出来的必须保证 target 是 armeabi-v7a 因为你的是TARGET_ARCH_ABI :=armeabi-v7a |
感谢大神,稍后我问问对方 |
|
请问lz这个问题解决了么,遇到和lz差不多 的问题
|
|
我有个问题,我有一个第三方的库文件。我分别用arm-linux-android 和i686-linux-android编译了两个版本。libsp.so。 |