无法使用VS 2013 RTM编译OpenCV 2.4.5 [英] Cannot Compile OpenCV 2.4.5 with VS 2013 RTM

查看:143
本文介绍了无法使用VS 2013 RTM编译OpenCV 2.4.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能用VS 2013 RTM编译openCV吗?我已经尝试过,在IlmImf模块中得到一堆"min不属于命名空间std""max不属于命名空间std",并且opencv_features2d不会编译并出现以下错误:

Has anyone had any luck compiling openCV with VS 2013 RTM? I have tried and get a bunch of "min doesn't belong to namespace std" "max doesn't belong to namespace std" in the IlmImf module, and opencv_features2d doesn't compile with the following error:

opencv \ modules \ core \ include \ opencv2/core/core.hpp(4512):致命错误C1075:在'...... \ modules左括号'{'之前找到文件结尾\ features2d \ src \ features2d_init.cpp(187)'已匹配

由于最新的CMake UI尚不支持使用2013进行构建(至少从UI而言,我是菜鸟),因此我的过程是为2012配置CMake,然后使用2013打开生成的解决方案并升级编译器到vc12.

Since the latest CMake UI doesn't yet support building with 2013 (at least from the UI and I'm a noob), my process was configuring CMake for 2012, and then opening the generated solution with 2013 and upgrading the compiler to vc12.

我能够通过在违规"文件中添加标头包含来克服最小/最大错误,但我为上面发布的全部错误所困扰.

I was able to get past the min/max errors by adding header includes for in the 'offending' files, but I am stumped by the full error I posted above.

谢谢

更新:

接受的答案提供了在32位调试和发行版以及64位调试中编译OpenCV所需的条件,但是现在,由于内部编译器错误,编译器无法编译64位发行版.此时可能是编译器的错误,但是答案仍然是解决了许多问题.

The accepted answer provides what is necessary to compile OpenCV in 32-bit debug and release, and 64-bit debug, but now the compiler fails to compile 64-bit release due to an internal compiler error. This is likely the compiler's fault at this point, but the answer is still solves many problems.

更新2: 因此,原来的64位问题是自动矢量化程序中的错误.这是相应的解决方法.

Update 2: So the 64-bit issue turned out to be a bug in the auto-vectorizer. Here is the corresponding workaround.

您好,感谢您提供的错误报告.我确认这是编译器优化器中的错误.我们将在以后的版本中对其进行修复.

Hi, thanks for the great bug report. I confirm this is a bug in the compiler optimizer. We will fix it in a future release.

如果您需要源代码解决方法,请在 computeOrbDescriptor 内部的循环上关闭矢量化器:

If you need a source code workaround, please turn the vectorizer off on the loop inside computeOrbDescriptor:

#pragma循环(无向量)

表示(int i = 0; i< dsize; ++ i)

{

   **...**

这使我可以构建orb.cpp& stardetector.cpp.

That lets me build orb.cpp & stardetector.cpp.

如果此问题很严重,导致严重的业务状况或阻止了您的产品开发或部署,请访问 http://support .microsoft.com 或致电1-800-MICROSOFT以寻求帮助.对于Microsoft高级客户,请与您的管理员,技术客户经理或Microsoft高级客户代表联系.

If this issue is severe, causing critical business situations or blocking your product development or deployment, please go to http://support.microsoft.com or call 1-800-MICROSOFT for assistance. For Microsoft premier customers, please contact your administrator, your Technical Account Manager, or your Microsoft premier account representative.

我正在关闭此MSConnect项.如果您还有其他需要,请随时答复.

I am closing this MSConnect item. Feel free to respond if you need anything else.

谢谢

Eric Brumer-Microsoft Visual C ++团队

Eric Brumer - Microsoft Visual C++ Team

可以在此处.不幸的是,此问题的真正解决方法已推迟到以后.

The connect bug can be found here. Unfortunately the real fix for this is postponed until a later date.

推荐答案

我设法在VS2013 RC上编译了OpenCV 2.4.6,但最初它具有与所讨论的相同的错误. 我已经打开了VS解决方案,并通过两个步骤修复了所有错误:

I've managed to compile OpenCV 2.4.6 on VS2013 RC, but initially it had the same errors as in question. I've opened VS solution and fixed all error in two steps:

1)替换为(Ctrl + H)

1) Replaced (Ctrl+H)

#include \<string\> 

#include <algorithm>\n#include <string>

<整个解决方案中的

(请确保在替换"对话框中启用RegExp)

in entire solution (be sure to enable RegExp in replace dialog)

2)在模块/opencv_features2d/Src/features2d_init.cpp"中,将第184行更改为:

2) In "modules/opencv_features2d/Src/features2d_init.cpp" changed line 184 to:

obj.info()->addParam(obj, "detector", (Ptr<Algorithm>&) obj.detector);

(在此文件中搜索"GridAdaptedFeatureDetector"以获取其他OpenCV版本)

(search for "GridAdaptedFeatureDetector" in this file for other OpenCV versions)

这篇关于无法使用VS 2013 RTM编译OpenCV 2.4.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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