我对'使用命名空间'声明的范围感到困惑......希望有人能为我解决这个问题!对命名空间范围感到困惑!
我使用两个库(OpenCV和Ogre3D)。我有两个cpp文件,一个专门使用OpenCV(PoseEstimator.cpp),另一个专门使用Ogre3D(OgreLogic.cpp)。
OgreLogic.cpp的顶部看起来是这样的:
#include "stdafx.h"
#include "PoseEstimator.h"
#include "OgreLogic.h"
using namespace Ogre;
而且PoseEstimator.cpp的顶部看起来是这样的:
#include "StdAfx.h"
#include "PoseEstimator.h"
using namespace cv;
using namespace std;
这 '使用命名空间CV' 只是在整个项目中发生(我通过搜索进行双重检查)。没有'在标题中使用命名空间,只有在cpp文件中。
然而,编译OgreLogic.cpp当我得到模棱两可的错误,如:
cxmat.hpp(3465):错误C2872: 'UCHAR' :暧昧的符号1>可能是 “D:\ libraries \ opencv2.1 \ include \ opencv \ cxtypes.h(154) :unsigned char uchar'1> or
'd:\ libraries \ ogresdk \ include \ ogre \ OgrePrerequisites.h(106) :Ogre :: uchar'
我好像误会了什么,因为我认为这应该是好的?
任何帮助非常感谢!
感谢,
杰克
谢谢你的帮助。 我通过将cxmat.hpp(openCV头)中的uchar引用更改为unsigned char来“解决”了问题。 似乎现在工作! – 2011-03-17 15:37:16
没问题 - 它工作吗? – spbots 2011-03-17 15:38:10
不小心发布了,试图按下输入做一个新的行,但被抓出来! – 2011-03-17 15:41:59