有时候cmake虽然显示configure成功了,实际编译时,还是会报错。

把configure成功的文件copy下来供参考:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
-- Detected processor: x86_64
-- Looking for ccache - found (/usr/bin/ccache)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
-- Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version >= 2.3.1). OpenJPEG will be built from sources
-- OpenJPEG: VERSION = 2.3.1, BUILD = opencv-4.4.0-dev-openjp2-2.3.1
-- OpenJPEG libraries will be built from sources: libopenjp2 (version "2.3.1")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Checking for module 'gtk+-3.0'
-- No package 'gtk+-3.0' found
-- Checking for module 'gtk+-2.0'
-- No package 'gtk+-2.0' found
-- Checking for module 'gthread-2.0'
-- No package 'gthread-2.0' found
-- IPPICV: Download: ippicv_2020_lnx_intel64_20191018_general.tgz
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
IPPICV: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ippicv/ippicv.cmake:37 (ocv_download)
cmake/OpenCVFindIPP.cmake:244 (download_ippicv)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:695 (include)
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY)
-- Could NOT find BLAS (missing: BLAS_LIBRARIES)
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- OpenCV Python: during development append to PYTHONPATH: /home/ubuntu/alina/opencv-4.4.0/build/python_loader
-- Checking for module 'libavresample'
-- No package 'libavresample' found
-- Checking for module 'gstreamer-base-1.0'
-- No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-app-1.0'
-- No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
-- No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
-- No package 'gstreamer-pbutils-1.0' found
-- Module opencv_alphamat disabled because the following dependencies are not found: Eigen
-- Caffe: NO
-- Protobuf: NO
-- Glog: NO
-- Checking for module 'freetype2'
-- No package 'freetype2' found
-- Checking for module 'harfbuzz'
-- No package 'harfbuzz' found
-- freetype2: NO
-- harfbuzz: NO
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version "")
-- Julia not found. Not compiling Julia Bindings.
-- Module opencv_ovis disabled because OGRE3D was not found
-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
-- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
-- Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
-- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
-- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
-- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
-- Checking for module 'tesseract'
-- No package 'tesseract' found
-- Tesseract: NO
-- Allocator metrics storage type: 'long long'
-- Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': /home/ubuntu/alina/opencv-4.4.0/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
-- opencv_dnn: filter out cuda4dnn source code
-- xfeatures2d/boostdesc: Download: boostdesc_bgm.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:11 (download_boost_descriptors)
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:11 (download_boost_descriptors)
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:11 (download_boost_descriptors)
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:11 (download_boost_descriptors)
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:11 (download_boost_descriptors)
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:11 (download_boost_descriptors)
-- xfeatures2d/boostdesc: Download: boostdesc_lbgm.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:11 (download_boost_descriptors)
-- xfeatures2d/vgg: Download: vgg_generated_48.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/vgg: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:12 (download_vgg_descriptors)
-- xfeatures2d/vgg: Download: vgg_generated_64.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/vgg: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:12 (download_vgg_descriptors)
-- xfeatures2d/vgg: Download: vgg_generated_80.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/vgg: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:12 (download_vgg_descriptors)
-- xfeatures2d/vgg: Download: vgg_generated_120.i
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
xfeatures2d/vgg: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
opencv_contrib/modules/xfeatures2d/CMakeLists.txt:12 (download_vgg_descriptors)
-- data: Download: face_landmark_model.dat
-- Try 1 failed
--
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
data: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
/home/ubuntu/alina/opencv-4.4.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
opencv_contrib/modules/face/CMakeLists.txt:13 (ocv_download)
CMake Warning at opencv_contrib/modules/face/CMakeLists.txt:26 (message):
Face: Can't get model file for face alignment.
--
-- General configuration for OpenCV 4.4.0-dev =====================================
-- Version control: unknown
--
-- Extra modules:
-- Location (extra): /home/ubuntu/alina/opencv-4.4.0/opencv_contrib/modules
-- Version control (extra): unknown
--
-- Platform:
-- Timestamp: 2020-09-21T02:24:01Z
-- Host: Linux 4.15.0-112-generic x86_64
-- CMake: 3.18.2
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: Release
--
-- CPU/HW features:
-- Baseline: SSE SSE2 SSE3
-- requested: SSE3
-- Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
-- requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
-- SSE4_1 (17 files): + SSSE3 SSE4_1
-- SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
-- FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
-- AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
-- AVX2 (31 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
-- AVX512_SKX (7 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ standard: 11
-- C++ Compiler: /usr/bin/c++ (ver 5.4.0)
-- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release): -Wl,--gc-sections -Wl,--as-needed
-- Linker flags (Debug): -Wl,--gc-sections -Wl,--as-needed
-- ccache: YES
-- Precompiled headers: NO
-- Extra dependencies: dl m pthread rt
-- 3rdparty dependencies:
--
-- OpenCV modules:
-- To be built: aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python2 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: alphamat cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype hdf java js julia matlab ovis python3 sfm viz xfeatures2d
-- Applications: tests perf_tests apps
-- Documentation: NO
-- Non-free algorithms: NO
--
-- GUI:
-- GTK+: NO
-- VTK support: NO
--
-- Media I/O:
-- ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8)
-- JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
-- WEBP: build (ver encoder: 0x020f)
-- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.54)
-- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.0.6)
-- JPEG 2000: build (ver 2.3.1)
-- OpenEXR: build (ver 2.3.0)
-- HDR: YES
-- SUNRASTER: YES
-- PXM: YES
-- PFM: YES
--
-- Video I/O:
-- DC1394: YES (2.2.4)
-- FFMPEG: YES
-- avcodec: YES (56.60.100)
-- avformat: YES (56.40.101)
-- avutil: YES (54.31.100)
-- swscale: YES (3.1.101)
-- avresample: NO
-- GStreamer: NO
-- v4l/v4l2: YES (linux/videodev2.h)
--
-- Parallel framework: pthreads
--
-- Trace: YES (with Intel ITT)
--
-- Other third-party libraries:
-- Lapack: NO
-- Eigen: NO
-- Custom HAL: NO
-- Protobuf: build (3.5.1)
--
-- OpenCL: YES (no extra features)
-- Include path: /home/ubuntu/alina/opencv-4.4.0/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
--
-- Python 2:
-- Interpreter: /usr/bin/python2.7 (ver 2.7.12)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.12)
-- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.11.0)
-- install path: lib/python2.7/dist-packages/cv2/python-2.7
--
-- Python (for build): /usr/bin/python2.7
--
-- Java:
-- ant: NO
-- JNI: NO
-- Java wrappers: NO
-- Java tests: NO
--
-- Install to: /usr/local
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/alina/opencv-4.4.0/build
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
具体解析如下:
1、-- Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version >= 2.3.1). OpenJPEG will be built from sources
OpenJPEG功能是:图像内存压缩编码,是FFMPEG、opencv等的必要支撑功能
(Qv2ray辅助)官网下载路径:http://code.google.com/p/openjpeg/downloads/
官网下载的压缩包链接:https://download.csdn.net/download/weixin_44674956/12873923
