目录结构如下:
- test/
-- deps/
--- librtmp/
---- rtmp.h
---- Android.mk -> librtmp.a
--- .../ #other deps
-- Android.mk -> test.a
-- src/
--- flv_muxer.c
flv_muxer.c代码段:
#include "librtmp/rtmp.h"
编译错误:
$ ndk-build
[armeabi-v7a] Compile thumb : test <= flv_muxer.c
In file included from /Users/workdir/testproject/test/src/flv_muxer.c:9:0:
/Users/workdir/testproject/test/src/flv_muxer.h:13:26: fatal error: librtmp/rtmp.h: No such file or directory
#include "librtmp/rtmp.h"
^
compilation terminated.
make: *** Error 1
答案 0 :(得分:1)
我通过添加LOCAL_CFLAGS
或LOCAL_C_INCLUDES
解决了编译错误,如下所示:
- Android.mk - &gt; test.a
LOCAL_CFLAGS := -I$(LOCAL_PATH)/deps/
或
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/deps/ \
$(LOCAL_PATH)/deps/librtmp