当前位置: 动力学知识库 > 问答 > 编程问答 >

android - ndk-build produces make error 2

问题描述:

I'm tring to build simple android project with native code using ndk-r12b and got:

make (e=2): The system cannot find the file specified.

The output from cmd :

process_begin: CreateProcess(NULL, C:/android-ndk- r12/build//../toolchains/aarch

64-linux-android-4.6/prebuilt/windows-x86_64/bin/aarch64-linux-android-gcc -MMD

-MP -MF ./obj/local/arm64-v8a/objs/ndktest/ndktest.o.d -Ijni -DANDROID -Wa,--noe

xecstack -Wformat -Werror=format-security -isystem C:/android-ndk-r12/build//../

platforms/android-21/arch-arm64/usr/include -c jni/ndktest.c -o ./obj/local/arm6

4-v8a/objs/ndktest/ndktest.o, ...) failed.

make (e=2): The system cannot find the file specified.

make: *** [obj/local/arm64-v8a/objs/ndktest/ndktest.o] Error 2

Android.mk :

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := ndktest

LOCAL_SRC_FILES := ndktest.c

include $(BUILD_SHARED_LIBRARY)

Application .mk :

APP_ABI := all

ndktest.c :

#include <jni.h>

#include <string.h>

jstring Java_nativeex_com_example_nativeex_MainActivity_helloWorld(JNIEnv* env, jobject obj)

{

return (*env)->NewStringUTF(env, "hello");

}

Thanks.

分享给朋友:
您可能感兴趣的文章:
随机阅读: