windows10+opencv+cmake
cmake编译opencv遇见下列错误的解决方法
CMake Warning at cmake/OpenCVDownload.cmake:193 (message):
IPPICV: Download failed: 6;"Couldn't resolve host name"
For details please refer to the download log file:
C:/Users/freeyu/Desktop/opencv/opencv-4.1.0/cudabuild/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ippicv/ippicv.cmake:42 (ocv_download)
cmake/OpenCVFindIPP.cmake:243 (download_ippicv)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:773 (include)
CMake Warning at cmake/OpenCVDownload.cmake:193 (message):
ADE: Download failed: 35;"SSL connect error"
For details please refer to the download log file:
C:/Users/freeyu/Desktop/opencv/opencv-4.1.0/cudabuild/CMakeDownloadLog.txt
Call Stack (most recent call first):
modules/gapi/cmake/DownloadADE.cmake:10 (ocv_download)
modules/gapi/cmake/init.cmake:16 (include)
cmake/OpenCVModule.cmake:312 (include)
cmake/OpenCVModule.cmake:375 (_add_modules_1)
modules/CMakeLists.txt:7 (ocv_glob_modules)
CMake Warning at cmake/OpenCVDownload.cmake:193 (message):
FFMPEG: Download failed: 6;"Couldn't resolve host name"
For details please refer to the download log file:
C:/Users/freeyu/Desktop/opencv/opencv-4.1.0/cudabuild/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
modules/videoio/cmake/init.cmake:3 (include)
modules/videoio/cmake/init.cmake:24 (add_backend)
cmake/OpenCVModule.cmake:312 (include)
cmake/OpenCVModule.cmake:375 (_add_modules_1)
modules/CMakeLists.txt:7 (ocv_glob_modules)
CMake Warning at cmake/OpenCVDownload.cmake:193 (message):
FFMPEG: Download failed: 6;"Couldn't resolve host name"
For details please refer to the download log file:
C:/Users/freeyu/Desktop/opencv/opencv-4.1.0/cudabuild/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
modules/videoio/cmake/init.cmake:3 (include)
modules/videoio/cmake/init.cmake:24 (add_backend)
cmake/OpenCVModule.cmake:312 (include)
cmake/OpenCVModule.cmake:375 (_add_modules_1)
modules/CMakeLists.txt:7 (ocv_glob_modules)
CMake Warning at cmake/OpenCVDownload.cmake:193 (message):
FFMPEG: Download failed: 6;"Couldn't resolve host name"
For details please refer to the download log file:
C:/Users/freeyu/Desktop/opencv/opencv-4.1.0/cudabuild/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
modules/videoio/cmake/init.cmake:3 (include)
modules/videoio/cmake/init.cmake:24 (add_backend)
cmake/OpenCVModule.cmake:312 (include)
cmake/OpenCVModule.cmake:375 (_add_modules_1)
modules/CMakeLists.txt:7 (ocv_glob_modules)
解决方法
在使用cmake编译时会在opencv下新建一个文件夹,我的是cudabuild
在cudabuild文件夹下找到CMakeDownloadLog.txt
以 **IPPICV: Download failed: 6;“Couldn’t resolve host name”**错误为例
在CMakeDownloadLog.txt找到对应IPPICV信息
IPPICV信息
#do_unpack "ippicv_2019_win_intel64_20180723_general.zip" "1d222685246896fe089f88b8858e4b2f" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_intel64_20180723_general.zip" "C:/Users/freeyu/Desktop/opencv/opencv-4.1.0/cudabuild/3rdparty/ippicv"
#cmake_download "C:/Users/freeyu/Desktop/opencv/opencv-4.1.0/sources/.cache/ippicv/1d222685246896fe089f88b8858e4b2f-ippicv_2019_win_intel64_20180723_general.zip" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_intel64_20180723_general.zip"
- 在IPPCV信息里找到下载路径https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_intel64_20180723_general.zip
- 打开https://ghproxy.com/,复制路径,就会下载ippicv_2019_win_intel64_20180723_general.zip
- 在IPPCV信息里找到C:/Users/freeyu/Desktop/opencv/opencv-4.1.0/sources/.cache/ippicv/1d222685246896fe089f88b8858e4b2f-ippicv_2019_win_intel64_20180723_general.zip
- 把下载的文件重命名为1d222685246896fe089f88b8858e4b2f-ippicv_2019_win_intel64_20180723_general.zip
- 把重命名的文件放入C:/Users/freeyu/Desktop/opencv/opencv-4.1.0/sources/.cache/ippicv中,原来的文件直接可以查看一下是0kb,直接删掉就行
其他问题的解决方法同理