I am a new learner of Android and I'm trying an android ndk demo with Ubuntu.
I run ndk-build and get the result below.
andylee@ubuntu:~/Downloads/android-ndk-r11-linux-
x86_64.tar.bz2/sources/hello/jni$ ndk-build -C
/home/andylee/Downloads/android-ndk-r11-linux-x86_64.tar.bz2/sources/hello
make: Entering directory '/home/andylee/Downloads/android-ndk-r11-linux-
x86_64.tar.bz2/sources/hello'
make: *** No rule to make target '/hello.c', needed by
'obj/local/armeabi/objs/helloARM/hello.o'. Stop.
make: Leaving directory '/home/andylee/Downloads/android-ndk-r11-linux-
x86_64.tar.bz2/sources/hello'
Then I delete the Android.mk in another folder (the folder structure is below) and get this.
andylee@ubuntu:~$ ndk-build -C /home/andylee/Downloads/android-ndk-r11-
linux-x86_64.tar.bz2/sources/hello
make: Entering directory '/home/andylee/Downloads/android-ndk-r11-linux-
x86_64.tar.bz2/sources/hello'
Android NDK: : Cannot find module with tag 'cxx-stl/system' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined
?
Android NDK: The following directories were searched:
Android NDK:
/home/andylee/Downloads/android-ndk-r11-linux-
x86_64.tar.bz2/build/core/setup-toolchain.mk:213: *** Android NDK: Aborting.
. Stop.
make: Leaving directory '/home/andylee/Downloads/android-ndk-r11-linux-
x86_64.tar.bz2/sources/hello'
My folder structure is like this.
home/andylee/Downloads/android-ndk-r11-linux-x86_64.tar.bz2
ndk-build
/sources
/cxx-stl
/system
/Android.mk
/hello
/jni
/hello.c
/hello.h
/Android.mk
Android.mk in jni folder
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := hello.c
LOCAL_MODULE := helloARM
LOCAL_CFLAGS += -pie -fPIE
LOCAL_LDFLAGS += -pie -fPIE
LOCAL_FORCE_STATIC_EXECUTABLE := true
include $(BUILD_EXECUTABLE)
hello.c
#include "hello.h"
int main(int argc, char *argv[]){
printf("Hello World!\n");
return 0;
}
hello.h
#ifndef HELLOHEADER_H_
#define HELLOHEADER_H_
#include <stdio.h>
#endif /*HELLOHEADER_H_*/
I wonder why ndk will find module with tag 'cxx-stl/system', I have not import any module in Android.mk. I've been frustrated with this for hours and I would really appreciate your help.