2012-03-21 69 views
1

我有一個OCR應用程序。我爲我的應用程序使用了tesseract api庫。但是,當我運行該應用程序,它會顯示錯誤(錯誤:ISO C++禁止'TessBaseAPI'沒有類型的聲明?)。錯誤:ISO C++禁止聲明'TessBaseAPI'沒有類型?

這是myt。

@interface OCRViewController : UIViewController <UIImagePickerControllerDelegate,UINavigationControllerDelegate>{ 
    UIImagePickerController *imagePickerController; 
    //Getting error in this line. 
    TessBaseAPI *tess; 
    UIImageView *iv; 
    UILabel *label; 
} 

回答

0

你必須添加的Tesseract命名空間,無論是與:

using namespace tesseract; 

或:

tesseract::TessBaseAPI *tess; 
0

我已經嘗試了以下解決這個還真管用 請重新命名

main.m ==> main.mm

ViewController.m ==> ViewController.mm

AppDelegate.m ==> AppDelegate.mm

這意味着直C++式頭文件將不再被包括(由參考)在你的普通Obj-C源代碼中。 希望有所幫助,並且有道理。如果這有幫助,那麼請給我豎起大拇指。 謝謝,

相關問題