问题描述
在试图创建一个使用Android的NDK-R8B它显示了错误的共享库
While trying to create a shared library using android-ndk-r8b it shows the error
Your APP_BUILD_SCRIPT points to an unknown file /home/myLib/ndk1/jni/Android.mk
Android NDK Aborting... .Stop
有关我的申请,我只是创建了包含ndk1.c文件和文件夹的JNI文件Android.mk
For my application,I simply created a jni folder which contains a ndk1.c file and Android.mk file
有关建馆步骤:
export ARM_ROOT=/home/myLib/android-ndk-r8b
export ARM_TOOL=/home/myLib/android-ndk-r8b/toolchains/arm-linux-androideabi-
4.4.3/prebuilt/linux-x86
export ARM_LIB=/home/myLib/android-ndk-r8b/platforms/android-8/arch-arm/usr/lib
export ARM_LIBO=/home/myLib/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3
export ARM_INC=/home/myLib/android-ndk-r8b/platforms/android-8/arch-arm/usr/include
export ARM_PRE=arm-linux-androideabi
export NDK=/home/myLib/android-ndk-r8b
export PATH=$PATH:/home/myLib/android-ndk-r8b
export NDK_PROJECT_PATH=/home/myLib/ndk1
请与您的宝贵建议帮助!
Please help with your valuable suggestions!!
推荐答案
这是NDK初学者非常好的教程
This is a very good tutorial for ndk beginnershttp://marakana.com/forums/android/examples/49.html
在教程:
因为你是建立在Android的NDK-R8B
更换步骤,说:
In tutorial :as you are building on android-ndk-r8breplace step which says
go to your NDK-HOME and run make APP=ndk_demo
做到这一点。
go to your android project directory and run ndk-build in terminal
清单
1)确保路径NDK路径设置为
1) Make sure path NDK path is set
2)确保您生成的头文件移动到文件夹JNI
2) Make sure you generated the header file and moved to jni folder
3)复制从头文件中相应的函数签名的C文件
这是一个地方的人犯错误参照的例子,他们盲目地在使用其它的什么包名和类名拷贝函数签名。
3) You copied appropriate function signature from the header file to your c filethis a place people make mistakes while referring to examples they blindly copy the function signature while using some other package name and class name.
JNIEXPORT jint JNICALL Java_com_your_package_class_method(JNIEnv *d, jobject e, jstring f);
4)使文件是JNI文件夹内present并包含正确的C文件名称
4)Make file is present inside your jni folder and contains the correct c file name
5)你在正确的目录中运行NDK的构建,即,项目的主目录
5)You are running ndk-build in correct directory ,i.e., project home directory
这篇关于失败使用Android的NDK在Linux下创建共享库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!