如何解决无法找到包含文件时编译opencv3.0与额外的模型与CMAKE 3.4.1和VS2015 [英] How to solve that cannot find include file when compiling opencv3.0 with extra models with CMAKE 3.4.1 and VS2015

查看:4659
本文介绍了如何解决无法找到包含文件时编译opencv3.0与额外的模型与CMAKE 3.4.1和VS2015的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用CMAKE 3.4.1和VS2015构建OPENCV 3.0时。 VS2015呈现以下错误:

When Building the OPENCV 3.0 with CMAKE 3.4.1 and VS2015. VS2015 presents the following mistakes:

error   C2264   "std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::tuple": error;opencv_perf_core E:\OpenCV3\sources\modules\core\perf\opencl\perf_channels.cpp   187 
error       Cannot open scr file "opencv2/core/hal/intrin.hpp"  opencv_xphoto   e:\OpenCV3\sources\modules\xphoto\src\grayworld_white_balance.cpp   43  
error   C1083   Cannot open include file: "opencv2/core/hal/intrin.hpp": No such file or directory  opencv_xphoto   E:\OpenCV3\sources\modules\xphoto\src\grayworld_white_balance.cpp   43  
error   C2610   "std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::tuple(const std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth> &)":  E:\OpenCV3\sources\modules\core\perf\opencl\perf_channels.cpp)    opencv_perf_core    D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple    328 
error   C2610   "std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::tuple(std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth> &&)":  E:\OpenCV3\sources\modules\core\perf\opencl\perf_channels.cpp) opencv_perf_core    D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple    329 
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> &)":  E:\OpenCV3\sources\modules\core\perf\opencl\perf_channels.cpp)   opencv_perf_core    D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple    463 
error   C2382   "std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::operator =": E:\OpenCV3\sources\modules\core\perf\opencl\perf_channels.cpp)    opencv_perf_core    D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\tuple    463 
error   C2264   "std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth>::tuple": 函数定义或声明中有error;未调用函数   opencv_perf_core    E:\OpenCV3\sources\modules\core\perf\opencl\perf_channels.cpp   165 
error   C1083   Cannot open include file: "opencv2/core/hal/intrin.hpp": No such file or directory  opencv_ximgproc E:\OpenCV3\sources\modules\ximgproc\src\fgs_filter.cpp  38  
error   C1083   Cannot open include file: "opencv2/core/hal/hal.hpp": No such file or directory opencv_aruco    E:\OpenCV3\sources\modules\aruco\src\dictionary.cpp 44  
error   C1083   Cannot open include file: "opencv2/core/hal/hal.hpp": No such file or directory opencv_ximgproc E:\OpenCV3\sources\modules\ximgproc\src\sparse_match_interpolators.cpp  41  
error   C1083   Cannot open include file: "opencv2/core/hal/hal.hpp": No such file or directory opencv_xfeatures2d  E:\OpenCV3\sources\modules\xfeatures2d\src\sift.cpp 108 
error   C1083   Cannot open include file: "opencv2/core/hal/hal.hpp": No such file or directory opencv_optflow  E:\OpenCV3\sources\modules\optflow\src\motempl.cpp  44  
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_aruco300d.lib"  opencv_test_aruco   E:\OpenCV3\sources\build\modules\aruco\LINK 1   
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_optflow300d.lib"    opencv_test_optflow E:\OpenCV3\sources\build\modules\optflow\LINK   1   
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_xfeatures2d300d.lib"    opencv_stitching    E:\OpenCV3\sources\build\modules\stitching\LINK 1   
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_stitching300d.lib"  opencv_perf_stitching   E:\OpenCV3\sources\build\modules\stitching\LINK 1   
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_xphoto300d.lib" opencv_perf_xphoto  E:\OpenCV3\sources\build\modules\xphoto\LINK    1   
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_ximgproc300d.lib"   opencv_perf_ximgproc    E:\OpenCV3\sources\build\modules\ximgproc\LINK  1   
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_xfeatures2d300d.lib"    opencv_perf_xfeatures2d E:\OpenCV3\sources\build\modules\xfeatures2d\LINK   1   
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_stitching300d.lib"  opencv_test_stitching   E:\OpenCV3\sources\build\modules\stitching\LINK 1   
error   C2065   "vector_Rect2d": Undeclared identifier  opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22172   
error   C2146   syntax error: missing";"(在标识符"boundingBox"的前面)  opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22172   
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22172   
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22179   
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22181   
error   C2065   "vector_Rect2d": Undeclared identifier  opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22191   
error   C2146   syntax error: missing";"    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22191   
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22191   
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22197   
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22199   
error   C2065   "vector_Rect2d": Undeclared identifier  opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22216   
error   C2146   syntax error: missing";"opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22216   
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22216   
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22223   
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_types.h 22224   
error   C2065   "vector_Rect2d": Undeclared identifier  opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_funcs.h 7839    
error   C2146   syntax error: missing";"    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_funcs.h 7839    
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_funcs.h 7839    
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_funcs.h 7846    
error   C2065   "boundingBox": Undeclared identifier    opencv_python2  E:\OpenCV3\sources\build\modules\python2\pyopencv_generated_funcs.h 7848    
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_xfeatures2d300d.lib"    opencv_test_xfeatures2d E:\OpenCV3\sources\build\modules\xfeatures2d\LINK   1   
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_ximgproc300d.lib"   opencv_test_ximgproc    E:\OpenCV3\sources\build\modules\ximgproc\LINK  1   
error   LNK1104 Cannot open file"..\..\lib\Debug\opencv_xphoto300d.lib" opencv_test_xphoto  E:\OpenCV3\sources\build\modules\xphoto\LINK    1   

我认为问题可能来自opencv2 /core/hal/intrin.hpp和opencv2 / core / hal / hal.hpp。但是,在我指定包含文件。更多的问题里面的代码出来,像没有这样的事情像cv :: hal等所以我完全丢失的错误。

I thought the problem may come from "opencv2/core/hal/intrin.hpp" and "opencv2/core/hal/hal.hpp". However after I specify the include file. more problem inside the code come up like such as there is no such thing like cv::hal etc. So I completely loss in the errors.

我使用下面的教程配置和编译我的Cmake和VS: https://putuyuwono.wordpress.com/2015/04/23/building-and-installing-opencv-3-0-on-windows-7-64-bit/

I use the following tutorial to config and compile my Cmake and VS: https://putuyuwono.wordpress.com/2015/04/23/building-and-installing-opencv-3-0-on-windows-7-64-bit/

我需要使用Xfeatures2d,所以我该怎么做呢?非常感谢和圣诞快乐〜

I need to use Xfeatures2d so what can I do to make it? Thank you very much and merry christmas~

推荐答案

尝试使用OpenCV 3.1源代码。

Try your build with the OpenCV 3.1 source.

由于你正在构建Xfeatures2d,你似乎已经将opencv_contrib模块添加到源代码树中。我在过去一周做了同样的事情,我下载的opencv_contrib版本只能使用现在可用的OpenCV 3.1构建。使用OpenCV 3.0我有完全相同的第一个错误消息你看到(无法打开scr文件opencv2 / core / hal / intrin.hpp)。看来hal已经移动到OpenCV 3.1中的核心。

Since you are building Xfeatures2d it appears that you have added the opencv_contrib module to your source tree. I did the same thing in the past week and the version of opencv_contrib that I downloaded would only build with OpenCV 3.1 which is now available. With OpenCV 3.0 I had exactly the same first error message you are seeing (Cannot open scr file "opencv2/core/hal/intrin.hpp"). It appears that hal has been moved to core in OpenCV 3.1.

试试。所有模块现在正在使用Visual Studio 2012在Windows 7下为我构建成功。注意:'opencv_extra_modules_path'必须在CMake中设置,我假设你还想要'with_cuda'set(并且你可能已经检查过了)。我使用CMake 2.8.12.2。

Give that a try. All modules are now building successfully for me under Windows 7 using Visual Studio 2012. Note: 'opencv_extra_modules_path' must be set in CMake and I assume you also want 'with_cuda' set (and you have probably already checked that). I am using CMake 2.8.12.2.

这篇关于如何解决无法找到包含文件时编译opencv3.0与额外的模型与CMAKE 3.4.1和VS2015的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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