OpenCV3.2使用Cmake进行编译时注意事项
最近使用OpenCVC3.2源码,结合CMake3.7.2进行编译,编译过程中可能会出现:
Downloading opencv_ffmpeg_64.dll...
CMake Error at cmake/OpenCVUtils.cmake:895 (file):
file DOWNLOAD HASH mismatch
for file: [D:/Program Files (x86)/opencv/sources/3rdparty/ffmpeg/downloads/35fe6ccdda6d7a04e9056b0d73b98e76/opencv_ffmpeg_64.dll]
expected hash: [35fe6ccdda6d7a04e9056b0d73b98e76]
actual hash: [f112aef8bcfad76757e2ebf06c7cf6e5]
status: [28;"Timeout was reached"]
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:15 (ocv_download)
cmake/OpenCVFindLibsVideo.cmake:206 (include)
CMakeLists.txt:536 (include)
CMake Error at cmake/OpenCVUtils.cmake:899 (message):
Failed to download opencv_ffmpeg_64.dll. Status=28;"Timeout was reached"
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:15 (ocv_download)
cmake/OpenCVFindLibsVideo.cmake:206 (include)
CMakeLists.txt:536 (include)
的错误,其原因主要是因为CMake从OpenCV相应的服务器远程下载opencv_ffmpeg_64.dll库时,可能会出现超时;同样,在下载opencv_ffmpeg.dll动态库和ippicv_windows_20151201.zip时都可能会出现类似问题,解决的办法:
1、重复进行config,直到能够顺利download相关的库;
2、从openCV相关git网址下载相应的库直接存放到…\OpenCV\3.2\source\3rdparty\ffmpeg\downloads\a423363a6eb76d362ca6c406c96c8db6、…\OpenCV\3.2\source\3rdparty\ffmpeg\downloads\f081abd9d6ca7e425d340ce586f9c090、…\OpenCV\3.2\source\3rdparty\ippicv\downloads\windows-04e81ce5d0e329c3fbc606ae32cad44d,然后进行config即可。