本人编译webrtc代码,遇到如下问题
In file included from E:/AndroidGips-Sample/jni/src/system_wrappers/source/map.c
c:11:
E:/AndroidGips-Sample/jni/src/system_wrappers/source/../interface/map_wrapper.h:
14:15: error: map: No such file or directory
In file included from E:/AndroidGips-Sample/jni/src/system_wrappers/source/map.c
c:11:
E:/AndroidGips-Sample/jni/src/system_wrappers/source/../interface/map_wrapper.h:
71: error: ISO C++ forbids declaration of 'map' with no type
查了半天发现是map找不到,后来才知道是不支持stl库
NDK R5之后增加了对C++ stl库的引用
所以在makefile中增加引用,同事在application.mk文件中增加相应应用即可
android.mk
增加:
LOCAL_SHARED_LIBRARIES := \
libcutils \
libdl \
libstlport
LOCAL_PRELINK_MODULE := false
ifndef NDK_ROOT
include external/stlport/libstlport.mk
endif
application.mk中增加:
APP_STL := stlport_static
webrtc的源码里没有application.mk文件,所以需要增加该文件,这一点很费解,google也太能折腾人了
注:application.mk是和android.mk在同一目录,即都jni目录下