[Android]Android NDK编译不识别list,map的问题

本人编译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目录下


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值