“分(安培;最大)不是一个std的成员”在Windows 8上构建的OpenCV 2.4.6当为Visual Studio 2012的错误 [英] 'min (& max) not a member of std' errors when building OpenCV 2.4.6 on Windows 8 for Visual Studio 2012

查看:369
本文介绍了“分(安培;最大)不是一个std的成员”在Windows 8上构建的OpenCV 2.4.6当为Visual Studio 2012的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Visual Studio 2012在Windows 8打造的OpenCV 2.4.6下载虽从 HTTPS源:// github上。 COM / Itseez / OpenCV的我生成使用cmake,然后加载生成的文件(离开默认配置) ALL_BUILD.vcxproj 到Visual Studio 2012年我再尝试构建它。几个模块确实建立(如核心,FLANN,imgproc,...),但我想建立highgui,这样我就可以使用PDB文件调试我的code(其中无法打开一个视频文件) 。构建错误本和许多类似的错误启动:

I'm trying to build OpenCV 2.4.6 on Windows 8 in Visual Studio 2012. Having downloaded the source from https://github.com/Itseez/opencv I generate (leaving the default configuration) using cmake and then load the resulting file ALL_BUILD.vcxproj into Visual Studio 2012. I then try to build it. Several of the modules do indeed build (e.g. core, flann, imgproc, ...) but I am trying to build highgui so that I can use the PDB file for debugging my code (which fails to open a video file). The build errors start with this and many similar errors:

错误C2039:最大:是不是'性病'C的成员:\\ OpenCV2.4.6 \\的3rdParty \\的OpenEXR \\ Imath \\ ImathMatrixAlgo.cpp 1094 1 IlmImf

error C2039: 'max' : is not a member of 'std' C:\OpenCV2.4.6\3rdparty\openexr\Imath\ImathMatrixAlgo.cpp 1094 1 IlmImf

对于这样的错误(例如,在这个答案)一个解决方法是添加的#include <&算法GT; 来失败的文件。我想,在一些文件,它似乎工作,但我很担心局部地改变源流行的库。它必须建立在Windows(你可以下载二进制文件,虽然不是PDB文件,从 OpenCV的SourceForge的网站),所以我会想了解如何构建它在我的机器上不改变源。

One fix for errors like this (e.g. in this answer) is to add #include <algorithm> to the failing files. I tried that on a few files and it seems to work but I'm nervous about locally changing the source for a popular library. It must build on Windows (you can download the binaries, though not the PDB files, from the OpenCV sourceforge site) so I would like to understand how to build it on my machine without changing the source.

我失去了一些东西在配置上一步?有一些路径设置等丢失我的机器上?为什么会出现这些错误,我应该如何解决这些问题?

Am I missing something out in the configuration step? Is there some path setting etc. missing on my machine? Why am I getting these errors and how should I fix them?

========== ==========编辑

========== EDIT ==========

寻找在这似乎是一个问题与第三方的一个依赖OpenEXR的目录路径。在Github上找 的它似乎是OpenEXR的1.7.1版本,在2.4 OpenCV的使用。 6。在OpenCV中的快速启动<一的说明href=\"http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html\">Installation在Windows 状态:

Looking at the directory path this appears to be a problem with one of the 3rd party dependencies, OpenEXR. Looking on Github it appears to be version 1.7.1 of OpenEXR that is used in OpenCV 2.4.6. The instructions in the OpenCV's Quick Start Installation on Windows state:


  • 在本征库的情况下,又是下载的情况下,并解压到D:/ OpenCV的/ DEP目录

  • 与上面的OpenEXR。

所以我下载了的OpenEXR 1.7.1源$ C ​​$ c释放并提取生成的文件把目录的OpenEXR-1.7.1 C:\\ OpenCV2.4.6 \\ DEP

so I downloaded the OpenEXR 1.7.1 source code release and extracted the resulting files putting the directory openexr-1.7.1 into C:\OpenCV2.4.6\dep.

然后我跑cmake并试图建立所产生的Visual Studio解决方案。可悲的是我看到了同样的错误。

Then I ran cmake and tried to build the resulting Visual Studio solution. Sadly I see the same errors.

推荐答案

我是绊脚石就同一问题在编译的OpenEXR。然后我找到了解决办法使用Google的的OpenEXR的std ::分钟

I was stumbling on the same issue while compiling OpenEXR. Then I found the solution googling for openexr std::min.

上的问题OpenCV的开通它说,使用VS2013 preVIEW时,您必须添加行的#include&LT;算法&gt;您正在使用该文件中的 的std ::分钟的std ::最大

There is an issue opened on OpenCV where it says that, when using VS2013 Preview, you must add the line #include <algorithm> in the file where you're using std::min and std::max.

我把那行成当这些方法被调用,瞧文件!编译成功了。

I put that line into the files where these methods are called and voilà! Compilation succeeded.

这篇关于“分(安培;最大)不是一个std的成员”在Windows 8上构建的OpenCV 2.4.6当为Visual Studio 2012的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆