标签:android ndk stl
1.配置NDK路径 NDKROOT
project->properties->c/c++ build->environment ,点击ADD 设置name为"NDKROOT",value 值为NDK路径,我的为"/Applications/android/android-ndk-r10b"
2.修改Android.mk
添加
#导入本地C++库,STL支持,此句最重要
LOCAL_C_INCLUDES += ${NDKROOT}/sources/cxx-stl/stlport/stlport
APP_STL := stlport_shared
3.可能会报错"undefined reference to ‘std::__node_alloc::_M_deallocate(void*, unsigned int)"
解决办法:
修改Android.mk
添加
LOCAL_CFLAGS := \
‘-D_STLP_USE_NEWALLOC‘
标签:android ndk stl
原文地址:http://blog.csdn.net/a87b01c14/article/details/45092655