OpenCV 2.4.2 编译"operations.hpp"问题
OpenCV 2.4.2 Compile Issues in "operations.hpp"
我正在尝试在Windows x64和Netbeans上安装openCV 2.4.2。我遵循了以下指南:http://projectsfromhellandmore.blogspot.co.nz/2012/06/opencv-241-netbeans-windows-7-plus.html
当我试图编译指南中包含的示例代码时,我在文件"include/opencv2/core/operations.hpp"中的以下代码块中遇到了以下错误,我还没有找到任何修复方法,也没有自己想好如何修复:
template<typename _Tp, typename _Base> inline void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
Ptr<_Tp>& value, bool readOnly, Ptr<_Tp> (Algorithm::*getter)(), void (Algorithm::*setter)(const Ptr<_Tp>&),
const string& help)
{
//TODO: static assert: _Tp inherits from _Base
addParam_(algo, parameter, ParamType<_Base>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
错误:得到2个模板参数,但需要1个
第二个有错误的代码块是:
template<typename _Tp> inline void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
Ptr<_Tp>& value, bool readOnly, Ptr<_Tp> (Algorithm::*getter)(), void (Algorithm::*setter)(const Ptr<_Tp>&),
const string& help)
{
//TODO: static assert: _Tp inherits from Algorithm
addParam_(algo, parameter, ParamType<Algorithm>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
错误:重新定义。。。(第一块代码中的功能)
感谢
我在使用opencvv2.4.x的MinGW时遇到了同样的问题,后来发现operations.hpp文件没有任何问题。相反,我安装的MinGW编译器出现了故障。我从sourcefourge重新安装了编译器,它起作用了。检查你的netbeans编译器。
我也遇到了同样的问题。这个问题的解决方案就是注释掉整个模板内联函数。这个函数在一个函数下面声明了两次,这就是问题的原因。只需评论其中一个。
相关文章:
- 警告处理为错误这里有什么问题
- 最小硬币更换问题(自上而下方法)
- 为"adjacent"变量赋值时出现问题
- 我的神经网络不起作用 [XOR 问题]
- 在Ubuntu 16.04上安装Cilk时出现问题
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 编译包含字符串的代码时遇到问题
- Project Euler问题4的错误解决方案
- 问题:什么是QAbstractItemView::NoEditTriggers的反面
- 在编译C++代码(具有dlib和opencv)到WASM时面临问题
- 在进程中对同一管道进行读取和写入时C++管道出现问题
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 静态数据成员的问题-修复链接错误会导致编译器错误
- C++ 雷神库 - 使用资源加载器类时出现问题(不命名类型)
- 一个关于在C++中重载布尔运算符的问题
- 首要问题的答案让值班员搞错了
- OpenCV 2.4.2 编译"operations.hpp"问题
- 遇到包括提升 binary_oarchive.hpp 在内的问题
- 添加 #include < boost/asio.hpp>会导致"has different size"问题
- H和HPP问题,包含顺序错误