I want to build OpenCV 3.2 for Visual Studio 2015 in Windows 10 with Cuda support. So, I configured it using CMake (see configuration file here). Cuda is installed and the path variable is set correctly. However, when building the OpenCV.sln
solution (debug, x64), I get in total 36 (3 different) errors, all referring to the cuda module:
C2610 C2535 C2382
Here one example per error code (Code, Description, Project File, Line):
Error C2610 'std::tuple::tuple(const std::tuple &)': is not a special member function which can be defaulted (compiling source file C:\Users\user\down\opencv3.2\opencv-src\modules\cudawarping\perf\perf_warping.cpp) opencv_perf_cudawarping C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple 607
Error C2535 'std::tuple &std::tuple::operator =(const std::tuple &)': member function already defined or declared (compiling source file C:\Users\user\down\opencv3.2\opencv-src\modules\cudawarping\perf\perf_warping.cpp) opencv_perf_cudawarping C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple 756
Error C2382 'std::tuple::operator =': redefinition; different exception specifications (compiling source file C:\Users\user\down\opencv3.2\opencv-src\modules\cudawarping\perf\perf_warping.cpp) opencv_perf_cudawarping C:\Users\user\down\opencv3.2\opencv-src\modules\ts\include\opencv2\ts\cuda_perf.hpp 76
EDIT:
This is reported as an issue for OpenCV 3.2.
Here is a good way to bypass the problem, posted by ThorbjornSomod (see issue):
I actually got it to work both on my laptop and my desktop (GTX960M and GTX970 respectively) running with OpenCV 3.2 and the latest version of CUDA 8.0 for Win10 in Visual Studio 15 Community! What I did was to enable WITH_CUBLAS aswell as WITH_CUDA. I also turned off BUILD_PERF_TESTS and BUILD_TESTS. The configuration was built using the Visual Studio 14 2015 C++ compiler.