在Android ndk中使用向量的致命错误

时间:2014-07-20 05:18:09

标签: android c++ android-ndk

我的项目在Android中使用本机代码。我尝试在我的一个文件中使用std :: vector并得到错误"fatal error: vector: No such file or directory"。我遵循了所有讨论here。我的Application.mk是

APP_STL := stlport_shared
LIB_TEST_DIR := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_PATH := $(LIB_TEST_DIR)

LOCAL_MODULE := usb_camera_simple_native

LOCAL_MODULE_FILENAME := libusb_camera_simple_native

LOCAL_CPP_EXTENSION := .cpp .cc .cxx

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include

LOCAL_CFLAGS := -DHAVE_CONFIG_H

LOCAL_SRC_FILES := com_astralink_orcas_api_UsbCamera.c

include $(BUILD_SHARED_LIBRARY)

我的路径设置如附件image所示。 我的文件包含vector header,如下所示。

#ifndef _ACCESSORIES_H_
#define _ACCESSORIES_H_
#include <vector>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct{
     int col;
     int row;
     int width;
     int height;
}loc_rects;
typedef struct{

     int numofppl;
     int camera_idx;
     unsigned char *frame;//image buffer
     std::vector<loc_rects> locs;
}container;


#ifdef __cplusplus
}
#endif
#endif

0 个答案:

没有答案