Android native示例小程序,为什么总是有问题?

cocofrom720 2016-05-17 02:56:26
文件结构如下所示:
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已经包含头文件了啊?为什么?请各位大神帮忙分析一下
...全文
105 1 打赏 收藏 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
cocofrom720 2016-05-17
  • 打赏
  • 举报
回复
自顶一下吧!

80,490

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧