Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tesseract Remove_Reference ambiguous symbol in project on visual studio 2012

I will describe my situation more in detail. I am building a system for the recognition of license plates, using C + + ,OpenCV ,Tesserect , but when I compile the code it is returned to me a stack of errors ambiguous references, so I inspected all lines of my code . I searched this group for solutions and have tried several without success.

Problems:

error C2872 : ' Remove_Reference ' : ambiguous symbol File: tesscallback.h Line : 1011
error C2872 : ' Remove_Reference ' : ambiguous symbol File: tesscallback.h Line : 1030
error C2872 : ' Remove_Reference ' : ambiguous symbol File: tesscallback.h Line : 1061
error C2872 : ' Remove_Reference ' : ambiguous symbol File: tesscallback.h Line : 1105
error C2872 : ' Remove_Reference ' : ambiguous symbol File: tesscallback.h Line : 1136
error C2872 : ' Remove_Reference ' : ambiguous symbol File: tesscallback.h Line : 1179
error C2872 : ' Remove_Reference ' : ambiguous symbol File: tesscallback.h Line : 1208

Software used:

MS visual studio 2012
Path to visual studio : " C : \ Program Files ( x86 ) \ Microsoft Visual Studio 11.0 \ Common7 \ IDE \ devenv.exe "
OpenCV version: 2.4.8
OS: Windows 7 Home Premium , 64 -bit
Core i7
Tesseract version: tesseract - 2.3.02 - win32 - lib -include -dirs ( tested other versions )
Inguagem used : C + +11

Thanks for Help

like image 677
Ricardo Avatar asked Dec 06 '22 01:12

Ricardo


2 Answers

I have been in trouble for couple days with exactly the same problem (I am working on plate recognition project by using tesseract also) and I have just solved it. REMOVE "using namespaces XXX" CODE LINES FROM YOUR HEADER FILES(.h) (if causing an error in .h files tolerate them by using std::vector or cv::Mat etc) AND USE "using namespace XXX" CODE LINES IN YOUR SOURCE CODE(.cpp file).

I refered this link: http://bytes.com/topic/net/answers/456267-idataobject-ambiguous-symbol-error

and sorry about my ENGLISH :)

like image 77
dogus yuksel Avatar answered Dec 28 '22 07:12

dogus yuksel


The thing is that the latest C++ has a definition of remove_reference in std , and tesscallback.h contains another definition. When you use using namespace std, compiler will give an error due to redefinition.

You can either delete all using namespace std and use std:: (recommended and explained here) or uncomment all definitions of remove_reference in tesscallback.h.

like image 40
Shawn Avatar answered Dec 28 '22 08:12

Shawn