错误解决——Cmake编译openCV出现“Error in configuration process,project files may be invalid”
在cmake对opencv编译的时候出现错误
错误粘贴如下:
``
错误 一
Can’t detect runtime and/or arch
FP16: Compiler support is available
CMake Warning at cmake/OpenCVUtils.cmake:1020 (message):
Download: Local copy of opencv_ffmpeg.dll has invalid MD5 hash:
6048172a1d2ebdc53194abc93c0e7c4a (expected:
f081abd9d6ca7e425d340ce586f9c090)
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download)
cmake/OpenCVFindLibsVideo.cmake:219 (include)
CMakeLists.txt:557 (include)
Downloading opencv_ffmpeg.dll…
CMake Error at cmake/OpenCVUtils.cmake:1043 (file):
file DOWNLOAD HASH mismatch
for file: [E:/Files/openCV/opencv/sources/3rdparty/ffmpeg/downloads/f081abd9d6ca7e425d340ce586f9c090/opencv_ffmpeg.dll]
expected hash: [f081abd9d6ca7e425d340ce586f9c090]
actual hash: [3108d97fa2ee09c8ee442db07b6367ca]
status: [28;“Timeout was reached”]
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download)
cmake/OpenCVFindLibsVideo.cmake:219 (include)
CMakeLists.txt:557 (include)
CMake Error at cmake/OpenCVUtils.cmake:1047 (message):
Failed to download opencv_ffmpeg.dll. Status=28;“Timeout was reached”
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download)
cmake/OpenCVFindLibsVideo.cmake:219 (include)
CMakeLists.txt:557 (include)
Configuring incomplete, errors occurred!
See also “E:/Files/openCV/opencv/newbuild/CMakeFiles/CMakeOutput.log”.
See also “E:/Files/openCV/opencv/newbuild/CMakeFiles/CMakeError.log”.
这是由于ffmpeg没下载成功所致
打开路径E:\Files\openCV\opencv\sources\3rdparty\ffmpeg\ffmpeg.cmake
中有下载地址(opencv下载地址前半截保存位置可能会不一样)
这里值得注意的是,下载地址要经过转换(黄框部分用另一个黄框替换)最后绿色添加到末尾
为了方便看清楚,我的下载地址如下,稍微比对一下就能看明白了:
https://raw.githubusercontent.com/opencv/opencv_3rdparty/2a19d0006415955c79431116e4634f04d5eb5a74/ffmpeg/opencv_ffmpeg.dll
此外还需要知道所下载的三个文件的哈希值:查询工具https://download.csdn.net/download/xubuhui/12032166
工具使用方法:点击exe安装之后找到需要查询的文件右击——》属性即可看到对应的MD5
opencv_ffmpeg.dll的MD5:F081ABD9D6CA7E425D340CE586F9C090
opencv_ffmpeg_64.dll的MD5:A423363A6EB76D362CA6C406C96C8DB6
ffmpeg_version.cmake的MD5: 216942A44FEBE61BD47E404AACD746FF
将下载得文件对应放到相应的文件夹中
E:\Files\openCV\opencv\sources\3rdparty\ffmpeg\downloads\F081ABD9D6CA7E425D340CE586F9C090
- 1
E:\Files\openCV\opencv\sources\3rdparty\ffmpeg\downloads\A423363A6EB76D362CA6C406C96C8DB6
- 1
E:\Files\openCV\opencv\sources\3rdparty\ffmpeg\downloads\216942A44FEBE61BD47E404AACD746FF
- 1
下载好之后再在cmake中进行configure
又出现错误如下:
Can't detect runtime and/or arch
FP16: Compiler support is available
Downloading ffmpeg_version.cmake...
Downloading ffmpeg_version.cmake... Done
ICV: Downloading ippicv_windows_20151201.zip...
CMake Error at 3rdparty/ippicv/downloader.cmake:73 (file):
file DOWNLOAD HASH mismatch
for file: [E:/Files/openCV/opencv/sources/3rdparty/ippicv/downloads/windows-04e81ce5d0e329c3fbc606ae32cad44d/ippicv_windows_20151201.zip]
expected hash: [04e81ce5d0e329c3fbc606ae32cad44d]
actual hash: [72e31e3fa2b51979a82c654e0b05c376]
status: [28;“Timeout was reached”]
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:110 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:243 (include)
cmake/OpenCVFindLibsPerf.cmake:37 (include)
CMakeLists.txt:558 (include)
CMake Error at 3rdparty/ippicv/downloader.cmake:77 (message):
ICV: Failed to download ICV package: ippicv_windows_20151201.zip.
Status=28;“Timeout was reached”
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:110 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:243 (include)
cmake/OpenCVFindLibsPerf.cmake:37 (include)
CMakeLists.txt:558 (include)
Configuring incomplete, errors occurred!
See also “E:/Files/openCV/opencv/newbuild/CMakeFiles/CMakeOutput.log”.
See also “E:/Files/openCV/opencv/newbuild/CMakeFiles/CMakeError.log”.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
由于ippicv未下载成功所致
下载地址在E:\Files\openCV\opencv\sources\3rdparty\ippicv\downloader.cmake
同上操作这里不再叙述
我的下载地址为(对应自己得电脑下载即可)
https://raw.githubusercontent.com/opencv/opencv_3rdparty/81a676001ca8075ada498583e4166079e5744668/ippicv/ippicv_windows_20151201.zip
https://raw.githubusercontent.com/opencv/opencv_3rdparty/81a676001ca8075ada498583e4166079e5744668/ippicv/ippicv_linux_20151201.tgz
此时用hash查询工具查询MD5
将文件保存我的电脑是windows其它得我就不展示了
放入路径E:\Files\openCV\opencv\sources\3rdparty\ippicv\downloads\windows-04e81ce5d0e329c3fbc606ae32cad44d
将文件放到相应得目录之后再次回到cmake
错误二
又出现错误
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_nppi_LIBRARY (ADVANCED)
linked by target "opencv_cudev" in directory E:/Files/openCV/opencv/sources/modules/cudev
linked by target "opencv_cudev" in directory E:/Files/openCV/opencv/sources/modules/cudev
linked by target "opencv_test_cudev" in directory E:/Files/openCV/opencv/sources/modules/cudev/test
linked by target "opencv_core" in directory E:/Files/openCV/opencv/sources/modules/core
linked by target "opencv_core" in directory E:/Files/openCV/opencv/sources/modules/core
linked by target "opencv_test_core" in directory E:/Files/openCV/opencv/sources/modules/core
linked by target "opencv_perf_core" in directory E:/Files/openCV/opencv/sources/modules/core
linked by target "opencv_test_cudaarithm" in directory E:/Files/openCV/opencv/sources/modules/cudaarithm
linked by target "opencv_cudaarithm" in directory E:/Files/openCV/opencv/sources/modules/cudaarithm
linked by target "opencv_cudaarithm" in directory E:/Files/openCV/opencv/sources/modules/cudaarithm
linked by target "opencv_perf_cudaarithm" in directory E:/Files/openCV/opencv/sources/modules/cudaarithm
linked by target "opencv_flann" in directory E:/Files/openCV/opencv/sources/modules/flann
linked by target "opencv_flann" in directory E:/Files/openCV/opencv/sources/modules/flann
linked by target "opencv_test_flann" in directory E:/Files/openCV/opencv/sources/modules/flann
linked by target "opencv_imgproc" in directory E:/Files/openCV/opencv/sources/modules/imgproc
linked by target "opencv_imgproc" in directory E:/Files/openCV/opencv/sources/modules/imgproc
linked by target "opencv_test_imgproc" in directory E:/Files/openCV/opencv/sources/modules/imgproc
linked by target "opencv_perf_imgproc" in directory E:/Files/openCV/opencv/sources/modules/imgproc
linked by target "opencv_test_ml" in directory E:/Files/openCV/opencv/sources/modules/ml
linked by target "opencv_ml" in directory E:/Files/openCV/opencv/sources/modules/ml
linked by target "opencv_ml" in directory E:/Files/openCV/opencv/sources/modules/ml
linked by target "opencv_test_video" in directory E:/Files/openCV/opencv/sources/modules/video
linked by target "opencv_video" in directory E:/Files/openCV/opencv/sources/modules/video
linked by target "opencv_video" in directory E:/Files/openCV/opencv/sources/modules/video
linked by target "opencv_perf_video" in directory E:/Files/openCV/opencv/sources/modules/video
linked by target "opencv_cudabgsegm" in directory E:/Files/openCV/opencv/sources/modules/cudabgsegm
linked by target "opencv_cudabgsegm" in directory E:/Files/openCV/opencv/sources/modules/cudabgsegm
linked by target "opencv_test_cudabgsegm" in directory E:/Files/openCV/opencv/sources/modules/cudabgsegm
linked by target "opencv_perf_cudabgsegm" in directory E:/Files/openCV/opencv/sources/modules/cudabgsegm
linked by target "opencv_cudafilters" in directory E:/Files/openCV/opencv/sources/modules/cudafilters
linked by target "opencv_cudafilters" in directory E:/Files/openCV/opencv/sources/modules/cudafilters
linked by target "opencv_test_cudafilters" in directory E:/Files/openCV/opencv/sources/modules/cudafilters
linked by target "opencv_perf_cudafilters" in directory E:/Files/openCV/opencv/sources/modules/cudafilters
linked by target "opencv_cudaimgproc" in directory E:/Files/openCV/opencv/sources/modules/cudaimgproc
linked by target "opencv_cudaimgproc" in directory E:/Files/openCV/opencv/sources/modules/cudaimgproc
linked by target "opencv_test_cudaimgproc" in directory E:/Files/openCV/opencv/sources/modules/cudaimgproc
linked by target "opencv_perf_cudaimgproc" in directory E:/Files/openCV/opencv/sources/modules/cudaimgproc
linked by target "opencv_perf_cudawarping" in directory E:/Files/openCV/opencv/sources/modules/cudawarping
linked by target "opencv_cudawarping" in directory E:/Files/openCV/opencv/sources/modules/cudawarping
linked by target "opencv_cudawarping" in directory E:/Files/openCV/opencv/sources/modules/cudawarping
linked by target "opencv_test_cudawarping" in directory E:/Files/openCV/opencv/sources/modules/cudawarping
linked by target "opencv_imgcodecs" in directory E:/Files/openCV/opencv/sources/modules/imgcodecs
linked by target "opencv_imgcodecs" in directory E:/Files/openCV/opencv/sources/modules/imgcodecs
linked by target "opencv_test_imgcodecs" in directory E:/Files/openCV/opencv/sources/modules/imgcodecs
linked by target "opencv_perf_imgcodecs" in directory E:/Files/openCV/opencv/sources/modules/imgcodecs
linked by target "opencv_perf_photo" in directory E:/Files/openCV/opencv/sources/modules/photo
linked by target "opencv_photo" in directory E:/Files/openCV/opencv/sources/modules/photo
linked by target "opencv_photo" in directory E:/Files/openCV/opencv/sources/modules/photo
linked by target "opencv_test_photo" in directory E:/Files/openCV/opencv/sources/modules/photo
linked by target "opencv_test_shape" in directory E:/Files/openCV/opencv/sources/modules/shape
linked by target "opencv_shape" in directory E:/Files/openCV/opencv/sources/modules/shape
linked by target "opencv_shape" in directory E:/Files/openCV/opencv/sources/modules/shape
linked by target "opencv_test_videoio" in directory E:/Files/openCV/opencv/sources/modules/videoio
linked by target "opencv_videoio" in directory E:/Files/openCV/opencv/sources/modules/videoio
linked by target "opencv_videoio" in directory E:/Files/openCV/opencv/sources/modules/videoio
linked by target "opencv_perf_videoio" in directory E:/Files/openCV/opencv/sources/modules/videoio
linked by target "opencv_cudacodec" in directory E:/Files/openCV/opencv/sources/modules/cudacodec
linked by target "opencv_cudacodec" in directory E:/Files/openCV/opencv/sources/modules/cudacodec
linked by target "opencv_perf_cudacodec" in directory E:/Files/openCV/opencv/sources/modules/cudacodec
linked by target "opencv_test_cudacodec" in directory E:/Files/openCV/opencv/sources/modules/cudacodec
linked by target "opencv_highgui" in directory E:/Files/openCV/opencv/sources/modules/highgui
linked by target "opencv_highgui" in directory E:/Files/openCV/opencv/sources/modules/highgui
linked by target "opencv_test_highgui" in directory E:/Files/openCV/opencv/sources/modules/highgui
linked by target "opencv_perf_objdetect" in directory E:/Files/openCV/opencv/sources/modules/objdetect
linked by target "opencv_objdetect" in directory E:/Files/openCV/opencv/sources/modules/objdetect
linked by target "opencv_objdetect" in directory E:/Files/openCV/opencv/sources/modules/objdetect
linked by target "opencv_test_objdetect" in directory E:/Files/openCV/opencv/sources/modules/objdetect
linked by target "opencv_ts" in directory E:/Files/openCV/opencv/sources/modules/ts
linked by target "opencv_ts" in directory E:/Files/openCV/opencv/sources/modules/ts
linked by target "opencv_test_features2d" in directory E:/Files/openCV/opencv/sources/modules/features2d
linked by target "opencv_features2d" in directory E:/Files/openCV/opencv/sources/modules/features2d
linked by target "opencv_features2d" in directory E:/Files/openCV/opencv/sources/modules/features2d
linked by target "opencv_perf_features2d" in directory E:/Files/openCV/opencv/sources/modules/features2d
linked by target "opencv_calib3d" in directory E:/Files/openCV/opencv/sources/modules/calib3d
linked by target "opencv_calib3d" in directory E:/Files/openCV/opencv/sources/modules/calib3d
linked by target "opencv_test_calib3d" in directory E:/Files/openCV/opencv/sources/modules/calib3d
linked by target "opencv_perf_calib3d" in directory E:/Files/openCV/opencv/sources/modules/calib3d
linked by target "opencv_cudafeatures2d" in directory E:/Files/openCV/opencv/sources/modules/cudafeatures2d
linked by target "opencv_cudafeatures2d" in directory E:/Files/openCV/opencv/sources/modules/cudafeatures2d
linked by target "opencv_test_cudafeatures2d" in directory E:/Files/openCV/opencv/sources/modules/cudafeatures2d
linked by target "opencv_perf_cudafeatures2d" in directory E:/Files/openCV/opencv/sources/modules/cudafeatures2d
linked by target "opencv_cudalegacy" in directory E:/Files/openCV/opencv/sources/modules/cudalegacy
linked by target "opencv_cudalegacy" in directory E:/Files/openCV/opencv/sources/modules/cudalegacy
linked by target "opencv_test_cudalegacy" in directory E:/Files/openCV/opencv/sources/modules/cudalegacy
linked by target "opencv_perf_cudalegacy" in directory E:/Files/openCV/opencv/sources/modules/cudalegacy
linked by target "opencv_cudaobjdetect" in directory E:/Files/openCV/opencv/sources/modules/cudaobjdetect
linked by target "opencv_cudaobjdetect" in directory E:/Files/openCV/opencv/sources/modules/cudaobjdetect
linked by target "opencv_perf_cudaobjdetect" in directory E:/Files/openCV/opencv/sources/modules/cudaobjdetect
linked by target "opencv_test_cudaobjdetect" in directory E:/Files/openCV/opencv/sources/modules/cudaobjdetect
linked by target "opencv_cudaoptflow" in directory E:/Files/openCV/opencv/sources/modules/cudaoptflow
linked by target "opencv_cudaoptflow" in directory E:/Files/openCV/opencv/sources/modules/cudaoptflow
linked by target "opencv_test_cudaoptflow" in directory E:/Files/openCV/opencv/sources/modules/cudaoptflow
linked by target "opencv_perf_cudaoptflow" in directory E:/Files/openCV/opencv/sources/modules/cudaoptflow
linked by target "opencv_perf_cudastereo" in directory E:/Files/openCV/opencv/sources/modules/cudastereo
linked by target "opencv_cudastereo" in directory E:/Files/openCV/opencv/sources/modules/cudastereo
linked by target "opencv_cudastereo" in directory E:/Files/openCV/opencv/sources/modules/cudastereo
linked by target "opencv_test_cudastereo" in directory E:/Files/openCV/opencv/sources/modules/cudastereo
linked by target "opencv_test_stitching" in directory E:/Files/openCV/opencv/sources/modules/stitching
linked by target "opencv_stitching" in directory E:/Files/openCV/opencv/sources/modules/stitching
linked by target "opencv_stitching" in directory E:/Files/openCV/opencv/sources/modules/stitching
linked by target "opencv_perf_stitching" in directory E:/Files/openCV/opencv/sources/modules/stitching
linked by target "opencv_superres" in directory E:/Files/openCV/opencv/sources/modules/superres
linked by target "opencv_superres" in directory E:/Files/openCV/opencv/sources/modules/superres
linked by target "opencv_test_superres" in directory E:/Files/openCV/opencv/sources/modules/superres
linked by target "opencv_perf_superres" in directory E:/Files/openCV/opencv/sources/modules/superres
linked by target "opencv_videostab" in directory E:/Files/openCV/opencv/sources/modules/videostab
linked by target "opencv_videostab" in directory E:/Files/openCV/opencv/sources/modules/videostab
linked by target "opencv_traincascade" in directory E:/Files/openCV/opencv/sources/apps/traincascade
linked by target "opencv_createsamples" in directory E:/Files/openCV/opencv/sources/apps/createsamples
linked by target "opencv_annotation" in directory E:/Files/openCV/opencv/sources/apps/annotation
linked by target "opencv_visualisation" in directory E:/Files/openCV/opencv/sources/apps/visualisation
linked by target "opencv_version" in directory E:/Files/openCV/opencv/sources/apps/version
Configuring incomplete, errors occurred!
See also "E:/Files/openCV/opencv/newbuild/CMakeFiles/CMakeOutput.log".
See also "E:/Files/openCV/opencv/newbuild/CMakeFiles/CMakeError.log".
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
参照这篇文章,这里面讲的很好,照做就可以了。
https://*.com/questions/46584000/cmake-error-variables-are-set-to-notfound
如何下载protobuf-cpp文件?
- 打开路径
E:\Files\openCV\opencv_contrib-3.2.0\opencv_contrib-3.2.0\modules\dnn\cmake\download_protobuf.cmake
并打开
将两者拼接起来即可进行下载如我的下载网址是
https://github.com/google/protobuf/releases/download/v3.1.0/protobuf-cpp-3.1.0.tar.gz
错误三
CMake Error at CMakeLists.txt:98 (project):
No CMAKE_CXX_COMPILER could be found.
CMake Error at CMakeLists.txt:98 (project):
No CMAKE_C_COMPILER could be found.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 问题原因
出现问题之后我重新安装了vs2015版后再次编译的时候出现该问题
原因在于安装新VS时未安装Windows SDK - 为visual Studio 安装组件的方式:打开控制面板找到程序与功能
- 找到自己安装的VS
- 右击更改——》修改——》安装即可
原文链接:https://blog.csdn.net/xubuhui/article/details/103533081
上一篇: Python数据可视化
下一篇: 有关字符串查找截取相关方法探究