2

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

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 :)

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;
}

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...

Community
  • 1
  • 1
Lech Migdal
  • 3,828
  • 5
  • 36
  • 63

1 Answers1

1

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)

Lech Migdal
  • 3,828
  • 5
  • 36
  • 63