使用Visual Studio编译opencv3.0时为什么会出错?

时间:2015-12-27 15:39:28

标签: c++ opencv visual-studio-2015

我想添加xfeatures2d模块,因此我下载opencv_contrib repo并将文件夹xfeatures2d复制到C:\opencv\sources\modules。然后CMake它。然后使用VS2015打开C:\opencv\MyBuild\OpenCV.sln。然后构建ALL_BUILD并遇到问题。 VS显示窗口说" Microsoft(R)C / C + +优化编译器已停止工作"。输出是:

1>------ Build started: Project: opencv_xfeatures2d, Configuration: Debug Win32 ------
2>------ Build started: Project: opencv_perf_core, Configuration: Debug Win32 ------
3>------ Build started: Project: opencv_test_core, Configuration: Debug Win32 ------
1>  sift.cpp
1>C:\opencv\sources\modules\xfeatures2d\src\sift.cpp(108): fatal error C1083: Cannot open include file: 'opencv2/core/hal/hal.hpp': No such file or directory
4>------ Build started: Project: opencv_stitching, Configuration: Debug Win32 ------
5>------ Build started: Project: opencv_test_xfeatures2d, Configuration: Debug Win32 ------
2>  perf_channels.cpp
3>  test_mat.cpp
2>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple(328): 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
2>  C:\opencv\sources\modules\core\perf\opencl\perf_channels.cpp(165): note: see reference to class template instantiation 'std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>' being compiled
2>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple(329): error C2610: 'std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::tuple(std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth> &&)': is not a special member function which can be defaulted
2>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple(463): error C2535: 'std::tuple<cv::Size,perf::`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
2>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple(367): note: see declaration of 'std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::operator ='
2>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple(463): error C2382: 'std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::operator =': redefinition; different exception specifications
2>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple(423): note: see declaration of 'std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::operator ='
2>C:\opencv\sources\modules\core\perf\opencl\perf_channels.cpp(165): error C2264: 'std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::tuple': error in function definition or declaration; function not called
2>C:\opencv\sources\modules\core\perf\opencl\perf_channels.cpp(165): fatal error C1903: unable to recover from previous error(s); stopping compilation
3>C:\opencv\sources\modules\core\include\opencv2/core/mat.inl.hpp(1597): error C3861: '.?AV?$Matx@N$01$01@cv@@': identifier not found
3>  C:\opencv\sources\modules\core\test\test_mat.cpp(1216): note: see reference to function template instantiation 'cv::Mat_<double>::operator cv::Matx<double,2,2>(void) const<2,2>' being compiled
3>  C:\opencv\sources\modules\core\test\test_mat.cpp(1216): note: see reference to function template instantiation 'cv::Mat_<double>::operator cv::Matx<double,2,2>(void) const<2,2>' being compiled
3>C:\opencv\sources\modules\core\include\opencv2/core/mat.inl.hpp(1597): error C2672: 'cv::Mat::operator cv::Matx<double,2,2>': no matching overloaded function found
6>------ Build started: Project: opencv_perf_xfeatures2d, Configuration: Debug Win32 ------
4>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_xfeatures2d300d.lib'
7>------ Build started: Project: opencv_perf_stitching, Configuration: Debug Win32 ------
6>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_xfeatures2d300d.lib'
8>------ Build started: Project: opencv_test_stitching, Configuration: Debug Win32 ------
5>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_xfeatures2d300d.lib'
7>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_stitching300d.lib'
8>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_stitching300d.lib'
========== Build: 0 succeeded, 8 failed, 51 up-to-date, 0 skipped ==========

0 个答案:

没有答案