在VS2015 Update 3中构建OpenCV 3.2时,xtr1中出现大量错误 [英] Tons of errors in xtr1common when building OpenCV 3.2 in VS2015 Update 3

查看:90
本文介绍了在VS2015 Update 3中构建OpenCV 3.2时,xtr1中出现大量错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在Visual Studio 2015 Update 3中使用OpenCV 3.2,目标x64(在3.2版本中没有x86库)构建简单的OpenCV应用程序时,出现以下错误:

When building a simple OpenCV app in Visual Studio 2015 Update 3, with OpenCV 3.2, with target x64 (there are no x86 libs in 3.2 release), I get the following errors:

1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(100): error C2737: 'std::is_same_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(100): error C2998: 'const bool std::is_same_v': cannot be a template definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(245): error C2737: 'std::is_integral_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(245): error C2998: 'const bool std::is_integral_v': cannot be a template definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(282): error C2737: 'std::is_floating_point_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(282): error C2998: 'const bool std::is_floating_point_v': cannot be a template definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(295): error C2737: 'std::is_arithmetic_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(295): error C2998: 'const bool std::is_arithmetic_v': cannot be a template definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstddef(697): error C2737: 'std::is_function_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstddef(697): error C2998: 'const bool std::is_function_v': cannot be a template definition

以某种方式,我不认为这是OpenCV的问题,所以我想我在构建过程中缺少某些内容或配置有误.任何建议应更改的建议均表示赞赏:)

Somehow I dont believe this is a problem with OpenCV, so I guess I am missing something in the build process or have something misconfigured. Any suggestions what should be changed are appreciated :)

我关注了以下网站 http: //opencv-srf.blogspot.com/2013/05/installing-configuring-opencv-with-vs.html 关于如何配置VS的建议.

I followed the following site http://opencv-srf.blogspot.com/2013/05/installing-configuring-opencv-with-vs.html when it comes to suggestions how to configure VS.

添加源代码,尽管我认为这与构建的配置有关,而不与源代码有关:

Adding source code, though I believe this is something related to configuration of the build, not to the source code:

#include "opencv2/opencv.hpp"

int main()
{
    return 0;
}

如通过 Visual Studio 2015:C ++ REST API(卡萨布兰卡)无法在VS inlcudes/headers中进行编译,并且可以通过从RC重新安装VS2015到完整社区版来解决.我正在使用VS2015 Enterprise Update 3,所以希望不是根本原因...

I get the same errors when adding OpenCV 3.1 through Nuget as described in OpenCV via NuGet packages with Visual Studio 2015, how to configure? . Interesting enough it looks like similar errors where seen in completely different cases - Visual Studio 2015: C++ REST API (Casablanca) failing compilation in VS inlcudes/headers and where solved by reinstalling VS2015 from RC to full community edition. I am using VS2015 Enterprise Update 3 so I hope is not the root cause...

推荐答案

此问题显然是由VS2015问题引起的.至少在我修复了VS2015安装之后(从Windows中的Program and Features,问题消失了)

This problem was apparently caused by issues with VS2015. At least after I did repair of the VS2015 installation (from Program and Features in Windows, the problem is gone)

这篇关于在VS2015 Update 3中构建OpenCV 3.2时,xtr1中出现大量错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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