我在maincontroller.h中得到这个错误“expected class name before”、“token”和“expected class name before”“token”。
我认为我包括了需要的文件,也在所有头文件中执行ifndef header定义header等操作,直到我编写了MainController类才有错误。
我不知道为什么会出现这个错误。我这里缺什么?
我有N4探险家签名。H:
class N4GestureRecognizer;
class N4GestureRecognizerDataSource{ /*it uses N4GestureRecognizer*/ };
class N4GestureRecognizerDelegate{ };
class N4GestureRecognizer {
...
};
N4fingertipgesturerecognizer.h公司
#include "N4GestureRecognizer.h"
class N4FingerTipGestureRecognizer;
class N4FingerTipGestureRecognizerDelegate : public N4GestureRecognizerDelegate{
public:
virtual void fingerTipGestureRecognizerCallback(N4FingerTipGestureRecognizer *recognizer) = 0;
};
class N4FingerTipGestureRecognizer : public N4GestureRecognizer{
...
};
和主控制器。
#include "N4GestureRecognizer.h"
#include "N4FingerTipGestureRecognizer.h"
using namespace cv;
//******Error is in the next line******
class MainController : public N4GestureRecognizerDatasource, public N4FingerTipGestureRecognizeDelegate{
protected:
Mat image;
public:
/*virtual*/ Mat gestureRecognizerNeedsImageFrame(N4GestureRecognizer *recognizer);
/*virtual*/ void fingerTipGestureRecognizerCallback(N4FingerTipGestureRecognizer *recognizer);
};