【发布时间】:2014-07-23 08:46:19
【问题描述】:
我目前正在处理 Android 原生代码。我有Accessorries.h
Accessories.h
#ifndef _ACCESSORIES_H_
#define _ACCESSORIES_H_
#define ANDROID 1
#include <string>
#include <opencv2/contrib/detection_based_tracker.hpp>
using namespace std;
using namespace cv;
#ifdef __cplusplus
extern "C" {
#endif
#define RETURN_OK 0
#define RETURN_MEMORY_ERROR 1
#define RETURN_PROCESS_ERROR 2
#define FACESIZE 0.2
#define WIDTH 400
#define HEIGHT 300
typedef struct{
int col;
int row;
int width;
int height;
}loc_rects;
typedef struct{
int numofppl;
int camera_idx;
unsigned char *frame;//image buffer
loc_rects *locs;
}container;
typedef struct{
int ctrl;
string frontxml;
string profilexml;
}processParam;
typedef struct{
DetectionBasedTracker::Parameters DetectorParams;
DetectionBasedTracker front;
DetectionBasedTracker profile;
}detectors;
#ifdef __cplusplus
}
#endif
#endif
Accessories.h 包含在 Detection.h & Detection.cpp 和 camera.c 中。
unknown type name namespace 有很多错误。
我使用 ndk-build 编译本机代码。
有什么问题?
我有路径和符号设置,如附图所示。
我为 GNU C 和 GNU C++ 设置了相同的设置。
编辑: 这是错误之一
C:/ndk/sources/cxx-stl/gnu-libstdc++/4.6/include/bits
/stl_vector.h:65:1: error: unknown type name 'namespace'
C:/ndk/sources/cxx-stl/gnu-libstdc++/4.6/include/bits
/stl_vector.h:66:1: error: expected ',' or ';' before '{' token
In file included from C:/ndk/sources/cxx-stl/gnu-libs
tdc++/4.6/include/vector:66:0,
from C:/Count//jni/include/opencv2/contrib/
detection_based_tracker.hpp:8,
from C:/Count//jni/Accessories.h:5,
from C:/Count//jni/FaceDetection.h:3,
from C:/Count//jni/com_astralink_orcas_api_
谢谢
【问题讨论】:
-
hii 你能粘贴确切的错误吗
-
不,我只包含在 Detection.h 和 Camera.c 中。
-
好的,您是否收到包含类似
asm ; ; ; ; ; redefinition was found here的错误信息 -
@yanivx 是的,我也得到了这些
标签: c++ c opencv android-ndk