2012-08-02 78 views
1

我想在Windows x64和Netbeans上安装openCV 2.4.2。我遵循以下指南:http://projectsfromhellandmore.blogspot.co.nz/2012/06/opencv-241-netbeans-windows-7-plus.htmlOpenCV 2.4.2“operations.hpp”中的编译问题

当我尝试编译指南中包含的示例代码时,我在文件“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); 
} 

错误:重新定义...(在代码的第一个块的功能)

任何帮助,将不胜感激感谢

回答

0

我使用MinGW面临同样的问题opencv2.4.x后来发现operations.hpp文件没有问题。相反,我安装的MinGW编译器存在错误。我从sourcefourge重新安装编译器,它工作。检查你的netbeans编译器。

1

我面临同样的问题。该问题的解决方案只是将整个模板内联函数注释掉。这个函数被声明两次,正好相反,这就是为什么这个问题。只是评论其中的一个。

+0

同样的问题在这里,在我的情况下,eclipse使用了一些Atmel-Studio工具链中的G ++(3.4.2),因为它没有与安装了4.8的系统路径相对应。谢谢! – 2013-11-10 12:26:09