android下编译C++(STL)报错
各位大牛们求教啊,小弟刚接触android,目前用C++写了代码,用到了STL,刚开始在A20平台上的android4.2上编译是没有问题的,后来换了平台,三星的4412平台上的android4.0.4上编译就报错了,提示map vector list 等路径找不到。
没有用NDK,是直接在android/external目录下用 mmm编译的
下面放上Android.mk文件及错误提示,希望大牛们可以帮忙啊!跪谢啊!
Android.mk文件内容如下:
LOCAL_PATH:= $(call my-dir)
#clear vars
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
#using stl
LOCAL_SDK_VERSION := 8
#LOCAL_NDK_VERSION := 5
LOCAL_NDK_STL_VARIANT := stlport_static
#LOCAL_NDK_STL_VARIANT := gnustl_static
#include src files
LOCAL_SRC_FILES:= hrproc.cpp hrmain.cpp
#module name
LOCAL_MODULE := hrmain
#add the head file path
#LOCAL_C_INCLUDES :=
#add the static lib file(*.a),in the path system lib
#LOCAL_STATIC_LIBRARIES :=
#add the shared lib file(*.so)
LOCAL_SHARED_LIBRARIES := libhr8000_syslib libhr8000_dblib libhr8000_protocol
#LOCAL_CPPFLAGS := -fPIC
#LOCAL_LDFLAGS := --no-warn-shared-textrel
#build to exe
include $(BUILD_EXECUTABLE)
#build to static lib
#include $(BUILD_STATIC_LIBRARY)
#build to shared lib
#include $(BUILD_SHARED_LIBRARY)
上面用到动态库都可以编译成功
错误提示:
external/hr8000/main/../include/hr8000_dbio.h:13:15: error: map: No such file or directory
external/hr8000/main/../include/hr8000_define.h:30:18: error: vector: No such file or directory
external/hr8000/main/../include/hr8000_define.h:32:16: error: list: No such file or directory
external/hr8000/main/../include/hr8000_define.h:34:18: error: bitset: No such file or directory