Android NDK项目中我们默认使用的是GNU C++库,其在NDK中的路径为:
${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include
可以将该路径添加到Properties -> C++ General -> Paths and Symbols -> includes项中
。
Application.mk文件中默认存在这么一行语句:APP_STL := gnustl_static
修改Android.mk文件,添加:
<code><span style="color: #ff0000;">LOCAL_C_INCLUDES += ${NDKROOT}/sources/cxx-stl/stlport/stlport</span>
同时修改Application.mk文件,添加以下语句:
<span style="color: #ff0000;">APP_STL := stlport_static</span>
然后在项目属性配置中添加NDK库的stlport所在路径
Properties; C++ General; Paths and Symbols ; includes项中添加即可。