Android native示例小程序,为什么总是有问题?
文件结构如下所示:
helloWorld/
-----Android.mk
-----main.cpp
-----test.cpp
------include/
-------test.h
main.cpp如下:
1 #include "stdio.h"
2 #include "test.h"
3 int main()
4 {
5 printf ("%d\n", add(1,2));
6 return 0;
7 }
test.cpp如下:
1 #include "test.h"
2
3 int add (int a, int b)
4 {
5 return a + b;
6 }
Android.mk如下:
1 LOCAL_PATH:= $(call my-dir)
2 include $(CLEAR_VARS)
3
4
5 LOCAL_SRC_FILES:= main.cpp \
6 test.cpp
7 LCOAL_C_INCLUDES:= \
8 $(LOCAL_PATH)/include
9 LOCAL_MODULE := helloworld
10 include $(BUILD_EXECUTABLE)
test.h 如下:
1 #ifndef ANDROID_TEST_H_
2 #define ANDROID_TEST_H_
3 int add (int a, int b);
4 #endif
mm编译后经常提示:
make: Entering directory `/home/huataol/AndroidM'
target thumb C++: helloworld <= huataol/helloWorld/main.cpp
huataol/helloWorld/main.cpp:2:18: fatal error: test.h: No such file or directory
#include "test.h"
^
compilation terminated.
make: *** [out/target/product/generic/obj/EXECUTABLES/helloworld_intermediates/main.o] Error 1
make: Leaving directory `/home/huataol/AndroidM'
但是我的LCOAL_C_INCLUDES已经包含头文件了啊?为什么?请各位大神帮忙分析一下