tesseract Remove_Reference在visual studio 2012项目中的模糊符号
tesseract Remove_Reference ambiguous symbol in project on visual studio 2012
我将更详细地描述我的情况。我正在使用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; };
相关文章:
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 无法在 CLion 中构建 C++ 项目
- 运行同一解决方案的另一个项目的项目
- CMake-按正确顺序将项目与C运行时对象文件链接
- 如何在选项卡视图Qt中设置一个新项目,并保存以前的项目
- 欧拉项目#8答案是大以获得有效答案
- 从链接列表c++中删除一个项目
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 既然存在危险,为什么项目要使用-I include开关
- cmake在我的项目中所需的所有静态库都不成功
- QT通过C++添加映射QML项目
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 在linux上调试巨大的C++项目
- 在其他文件中创建类时在 c++ 项目中不起作用
- 使外部项目可用于find_package CMake
- 在子目录中使用target_sources()命令时用于单元测试(qtest)的项目结构
- 使用外部SDK工具链文件在VisualStudio上生成项目编译错误
- 如何维护资源管理器项目视图中当前可见的项目列表
- 错误-我无法在VS2019中打开新的Qt项目
- tesseract Remove_Reference在visual studio 2012项目中的模糊符号