画像処理に OpenCV フレームワークを使用しています。通常の iOS プロジェクトの写真でエッジを特定しています。現在、cocos2d プロジェクトでこのコードを変換しています。必要なすべてのヘッダーをインポートしましたが、コンパイル中に次のエラーが発生します:expected specifier-qualifier- 'cv' の前にリストします。ここに私のコードがあります
#import "cocos2d.h"
#import "CameraController.h"
#import "Globals.h"
@interface BotoxEffectController : CCLayer
{ cv::VideoCapture *_videoCapture; cv::Mat _lastFrame;}//this is line where i am
getting error
@property (nonatomic, retain) CCSprite *sprite2D;
+(CCScene *) scene;
@end
here is code in .pch file.
#import <Availability.h>
#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif
#ifdef __cplusplus
#import <OpenCV/opencv2/opencv.hpp>
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
以下のスクリーン ショットを参照してください。BotoxEffectController クラス インターフェイスのエラーと実装ファイルの拡張子は .mm です。
ここにopencv.hppをインポートしている.pchファイルがあります