1 在需要调用模板库的文件前包含头文件:
#include
#include
LOCAL_C_INCLUDES := /home/administrator/android-ndk-r5b/sources/cxx-stl/stlport/stlport (ndk安装路径下的stl库)
2 在 mk 文件前加入:
APP_STL := stlprot_static (模板库以静态库的方式添加)
....
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog \
/home/administrator/android-ndk-r5b/sources/cxx-stl/stlport/libs/armeabi/libstlport_static.a