Error in Building OpenCV for Microsoft VS 2015 (Bug #4376)


Added by Ahmed Dawod almost 10 years ago. Updated over 9 years ago.


Status:New Start date:2015-06-03
Priority:High Due date:
Assignee:Ahmed Dawod % Done:

0%

Category:build/install
Target version:3.0
Affected version:branch 'master' (3.0-dev) Operating System:Windows
Difficulty:Medium HW Platform:x64
Pull request:

Description

I have: - Windows 8.1 x64 - VS 2015 Community Edition

I used this tutorial to build OpenCV to work with VS [[http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html]]

I followed everything and built the OpenCV from its sources using CMake the only components I didn't include are Intel © Integrated Performance Primitives (IPP), CUDA and QT

Everything went fine until the step where I open the solution OpenCV using VS and try to build it I had a list of 9 errors:

  • Severity Code Description Project File Line Error D8040 error creating or communicating with child process opencv_perf_core E:\OpenCV\Build\modules\core\cl 1

    Severity Code Description Project File Line Error C2264 'std::tuple<cv::size,perf::`anonymous-namespace'::matdepth>::tuple': error in function definition or declaration; function not called opencv_perf_core E:\OpenCV\Source\modules\core\perf\opencl\perf_channels.cpp 165

    Severity Code Description Project File Line Error C1903 unable to recover from previous error(s); stopping compilation opencv_perf_core E:\OpenCV\Source\modules\core\perf\opencl\perf_channels.cpp 165

    Severity Code Description Project File Line Error C2610 'std::tuple<cv::size,perf::anonymous-namespace'::MatDepth>::tuple(const std::tuple<cv::Size,perf::anonymous-namespace'::MatDepth> &)': is not a special member function which can be defaulted (compiling source file E:\OpenCV\Source\modules\core\perf\opencl\perf_channels.cpp) opencv_perf_core E:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple 325 Severity Code Description Project File Line Error C2610 'std::tuple<cv::size,perf::<code>anonymous-namespace'::MatDepth>::tuple(std::tuple<cv::Size,perf::anonymous-namespace'::MatDepth> &&)': is not a special member function which can be defaulted (compiling source file E:\OpenCV\Source\modules\core\perf\opencl\perf_channels.cpp) opencv_perf_core E:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple 326 Severity Code Description Project File Line Error C2535 'std::tuple<cv::size,perf::<code>anonymous-namespace'::MatDepth> &std::tuple<cv::Size,perf::anonymous-namespace'::MatDepth>::operator =(const std::tuple<cv::size,perf::`anonymous-namespace'::matdepth> &)': member function already defined or declared (compiling source file E:\OpenCV\Source\modules\core\perf\opencl\perf_channels.cpp) opencv_perf_core E:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple 452 Severity Code Description Project File Line Error C2382 'std::tuple<cv::size,perf::`anonymous-namespace'::matdepth>::operator =': redefinition; different exception specifications (compiling source file E:\OpenCV\Source\modules\core\perf\opencl\perf_channels.cpp) opencv_perf_core E:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple 452 Severity Code Description Project File Line Error C3861 '.?AV?$Matx@N$01$01@cv@@': identifier not found (compiling source file E:\OpenCV\Source\modules\core\test\test_mat.cpp) opencv_test_core E:\OpenCV\Source\modules\core\include\opencv2\core\mat.inl.hpp 1597 Severity Code Description Project File Line Error C2672 'cv::Mat::operator cv::Matx<double,2,2>': no matching overloaded function found (compiling source file E:\OpenCV\Source\modules\core\test\test_mat.cpp) opencv_test_core E:\OpenCV\Source\modules\core\include\opencv2\core\mat.inl.hpp 1597* So what is the solution?


History

Updated by Philip L almost 10 years ago

This seems to be an error of Visual Studio. I found this link (https://connect.microsoft.com/VisualStudio/feedback/details/800211/internal-compiler-error-with-qt-libraries) where a qt compilation is discussed on vs2015 rc and it seems to be fixxed in the release of vs2015

Severity Code Description Project File Line Error D8040 error creating or communicating with child process opencv_perf_core E:\OpenCV\Build\modules\core\cl 1

Updated by Nate Guerin over 9 years ago

I can reproduce the issue.

@Philip, when I read the content link that you attached, I don't see where it says this will be resolved in 2015 release. The latest comment from Microsoft on 2015.04.24 was:

__With the upcoming RC build of VS2015 I'm able to build both QT 4.8.4 and 5.4.1. Since this is not a compiler that's officially supported by QT yet, there are a few small source changes that need to be made, mostly in 3rd party libraries that QT tools depend on. These are primarily removing workarounds for older versions of the VC++ compiler.

Jonathan Emmett
Developer - Visual C++
__

Updated by Nate Guerin over 9 years ago

Nate Guerin wrote:

I can reproduce the issue.

@Philip, when I read the content link that you attached, I don't see where it says this will be resolved in 2015 release. The latest comment from Microsoft on 2015.04.24 was:

__With the upcoming RC build of VS2015 I'm able to build both QT 4.8.4 and 5.4.1. Since this is not a compiler that's officially supported by QT yet, there are a few small source changes that need to be made, mostly in 3rd party libraries that QT tools depend on. These are primarily removing workarounds for older versions of the VC++ compiler.

Jonathan Emmett
Developer - Visual C++
__

This issue is specifically caused by building the tests and the performance tests. When I removed the 'tests' and 'perf_tests' from the cmake makefile generator options, and used the new vs2015 solution the generator created, opencv compiled successfully:

========== Build: 181 succeeded, 0 failed, 0 up-to-date, 21 skipped ==========

@Ahmed, try removing the tests and perf_tests from the cmake options and compiling.

Updated by Philip L over 9 years ago

i was refering to the second comment:

Hello Monica,

Thanks for your patience here. Looks like Qt 4.8.4 is old version and current one is on 5.4.1. We're spending our investigations on the latest version of Qt with our current compiler. Also worth noting, the crash from the compiler on 4.8.4 is definitely gone and fixed with VS2015 release. Please stay tuned for status on 5.4.1.

Thanks,
Ulzii Luvsanbat
Visual C++ Team

You can still use all tests etc. since i am also using VS2015 RC for quite a while.
As said this is a compiler (rather an optimizer) problem of the vs 2015 internals.

But you are right you can disable both of these things if you want a clean working build.

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/5007

Also available in: Atom PDF