tesseract Remove_Reference在visual studio 2012项目中的模糊符号

tesseract Remove_Reference ambiguous symbol in project on visual studio 2012

本文关键字:项目 模糊 符号 2012 studio Remove Reference visual tesseract      更新时间:2023-10-16

我将更详细地描述我的情况。我正在使用c++,OpenCV,Tesserect构建一个车牌识别系统,但是当我编译代码时,它返回给我一堆错误模糊引用,所以我检查了我的代码的所有行。我在这个组里寻找解决办法,试了好几次都没有成功。

问题:

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
软件使用:

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

我已经遇到了几天的麻烦,完全相同的问题(我正在使用tesseract进行车牌识别项目),我刚刚解决了它。从你的头文件(.h)中删除"using namespaces XXX"代码行(如果在。h文件中导致错误,可以通过使用std::vector或cv::Mat等来容忍它们),并在你的源代码(.cpp文件)中使用"using namespace XXX"代码行。

我参考了这个链接:http://bytes.com/topic/net/answers/456267-idataobject-ambiguous-symbol-error

和抱歉我的英语:)

问题是最新的c++在std中有一个remove_reference的定义,而tesscallback.h包含另一个定义。使用using namespace std时,由于重定义,编译器会报错。

您可以删除所有using namespace std并使用std:: (推荐并解释了here)或取消tesscallback.h 中的所有definitions of remove_reference

我用下面的方法解决了同样的问题

// 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; };