gpt4 book ai didi

c++ - "operations.hpp"中的 OpenCV 2.4.2 编译问题

转载 作者:太空宇宙 更新时间:2023-11-03 22:34:21 24 4
gpt4 key购买 nike

我正在尝试在 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);
}

错误:重新定义了...(第一段代码中的函数)

非常感谢任何帮助,谢谢

最佳答案

我在使用 opencv2.4.x 的 MinGW 中遇到了同样的问题,后来发现 operations.hpp 文件没有任何问题。相反,我安装的 MinGW 编译器出了问题。我从 sourcefourge 重新安装了编译器,它工作了。检查您的 netbeans 编译器。

关于c++ - "operations.hpp"中的 OpenCV 2.4.2 编译问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11777958/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com