C++ 未知的类型名称命名空间
我目前正在研究Android本机代码。我有C++ 未知的类型名称命名空间,c++,c,opencv,android-ndk,C++,C,Opencv,Android Ndk,我目前正在研究Android本机代码。我有附件。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 __cplu
附件。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
谢谢 <代码>使用命名空间< /C> >仅为C++。对这些声明使用
#ifdef uu cplusplus
。hi您能粘贴我只包含在Detection.h和Camera.c中的确切错误吗。好的,您是否得到包含类似asm;;;的错误;在这里找到的重新定义< /COD> @ YANIVX是的,我得到了那些看起来像你所包含的文件--<代码>检测-BaseDeTraskH.pp/<代码> -C++。也许把所有东西都建成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_