5

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

War10ck
  • 12,387
  • 7
  • 41
  • 54
Ricardo
  • 677
  • 4
  • 11
  • 35

3 Answers3

7

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 :)

dogus yuksel
  • 111
  • 1
  • 5
5

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.

Community
  • 1
  • 1
Shawn
  • 456
  • 5
  • 11
4

I have solved the same problem by following method

// Specified by TR1 [4.7.2] Reference modifications.
// template <class T> struct remove_reference;
// template<typename T> struct remove_reference { typedef T type; };
// template<typename T> struct remove_reference<T&> { typedef T type; };