0
我在Eclipse中使用g ++編譯器導出一個dll類。我的操作系統是Ubuntu,該應用程序將在Ubuntu操作系統中運行。我創建了一個共享項目。使用g ++編譯器在Eclipse IDE中創建DLL類的錯誤
我有編譯錯誤的
expected constructor, destructor, or type conversion before ‘(’ token OCR_dll.h /OCR line 19 C/C++ Problem
錯誤發生在#define DLLCLASS __declspec(dllexport)
以及如何解決該錯誤。謝謝。
我的DLL代碼的頭文件是
OCR_dll.h
#ifndef OCR_DLL_H_
#define OCR_DLL_H_
#include <stdio.h>
#include <opencv/cv.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <tesseract/baseapi.h>
#include <iostream>
#include "Define.h"
#ifdef EXPORT
#define DLLCLASS __declspec(dllexport)
#else
#define DLLCLASS __declspec(dllimport)
#endif
using namespace cv;
#ifdef __cplusplus
extern "C" {
#endif
namespace VIDEOANALYTICS_PLATFORM {
class iOCR{
public:
virtual ~iOCR(){}
virtual int preProcessing(Mat &img) = 0;
virtual int textExtraction(Mat &img) = 0;
};
class OCR : public iOCR{
public:
OCR(){}
~OCR(){ ; }
int preProcessing(Mat &img);
int textExtraction(Mat &img);
private:
};
extern "C"{ DLLCLASS iOCR* __stdcall createOCRObject(); };
}
#ifdef __cplusplus
}
#endif
#endif /* OCR_DLL_H_ */