I have been building opencv-4.5.1-with-contrib in windows 10, but encountered a fatal error.
The building tool I used is cmake-gui(mingw64 in msys2) and mingw32-make.
The following is the error message:
$ mingw32-make
...
[ 64%] Processing OpenCL kernels (rgbd)
Scanning dependencies of target opencv_rgbd
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_cleaner.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_registration.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_to_3d.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dqb.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu_tsdf.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/fast_icp.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/hash_tsdf.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu_frame.cpp.obj
[ 64%] Building CXX object modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/large_kinfu.cpp.obj
In file included from D:/msys64/mingw64/include/ceres/internal/autodiff.h:153,
from D:/msys64/mingw64/include/ceres/autodiff_cost_function.h:130,
from D:/msys64/mingw64/include/ceres/ceres.h:37,
from D:\toolkit\opencv-4.5.1\opencv_contrib-4.5.1\modules\rgbd\src\pose_graph.hpp:15,
from D:\toolkit\opencv-4.5.1\opencv_contrib-4.5.1\modules\rgbd\src\submap.hpp:16,
from D:\toolkit\opencv-4.5.1\opencv_contrib-4.5.1\modules\rgbd\src\large_kinfu.cpp:12:
D:/msys64/mingw64/include/ceres/jet.h: In function 'double ceres::BesselJ0(double)':
D:/msys64/mingw64/include/ceres/jet.h:603:10: error: 'j0' was not declared in this scope
603 | return j0(x);
| ^~
D:/msys64/mingw64/include/ceres/jet.h: In function 'double ceres::BesselJ1(double)':
D:/msys64/mingw64/include/ceres/jet.h:610:10: error: 'j1' was not declared in this scope
610 | return j1(x);
| ^~
D:/msys64/mingw64/include/ceres/jet.h: In function 'double ceres::BesselJn(int, double)':
D:/msys64/mingw64/include/ceres/jet.h:617:10: error: 'jn' was not declared in this scope; did you mean 'n'?
617 | return jn(n, x);
| ^~
| n
mingw32-make[2]: *** [modules\rgbd\CMakeFiles\opencv_rgbd.dir\build.make:233: modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/large_kinfu.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:6043: modules/rgbd/CMakeFiles/opencv_rgbd.dir/all] Error 2
mingw32-make: *** [Makefile:165: all] Error 2
The following is my cmake configuration message:
General configuration for OpenCV 4.5.1 =====================================
Version control: unknown
Extra modules:
Location (extra): D:/toolkit/opencv-4.5.1/opencv_contrib-4.5.1/modules
Version control (extra): unknown
Platform:
Timestamp: 2021-07-05T03:02:13Z
Host: Windows 10.0.19042 AMD64
CMake: 3.20.3
CMake generator: MinGW Makefiles
CMake build tool: D:/toolkit/mingw64/bin/mingw32-make.exe
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: D:/msys64/mingw64/bin/x86_64-w64-mingw32-g++.exe (ver 10.3.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 -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -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 -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: D:/msys64/mingw64/bin/x86_64-w64-mingw32-gcc.exe
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -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=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,--gc-sections
Linker flags (Debug): -Wl,--gc-sections
ccache: NO
Precompiled headers: NO
Extra dependencies:
3rdparty dependencies:
OpenCV modules:
To be built: alphamat aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow ovis phase_unwrapping photo plot python3 quality rapid reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
Disabled: world
Disabled by dependency: -
Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype java julia matlab python2 viz
Applications: tests perf_tests apps
Documentation: NO
Non-free algorithms: YES
Windows RT support: NO
GUI:
Win32 UI: YES
VTK support: NO
Media I/O:
ZLib: build (ver 1.2.11)
JPEG: build-libjpeg-turbo (ver 2.0.6-62)
WEBP: build (ver encoder: 0x020f)
PNG: build (ver 1.6.37)
TIFF: build (ver 42 - 4.0.10)
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: NO
FFMPEG: YES (prebuilt binaries)
avcodec: YES (58.91.100)
avformat: YES (58.45.100)
avutil: YES (56.51.100)
swscale: YES (5.7.100)
avresample: YES (4.0.0)
GStreamer: NO
DirectShow: YES
Parallel framework: none
Trace: YES (built-in)
Other third-party libraries:
Lapack: NO
Eigen: YES (ver 3.3.9)
Custom HAL: NO
Protobuf: build (3.5.1)
OpenCL: YES (no extra features)
Include path: D:/toolkit/opencv-4.5.1/3rdparty/include/opencl/1.2
Link libraries: Dynamic load
Python 3:
Interpreter: D:/msys64/mingw64/bin/python3.exe (ver 3.8.9)
Libraries: D:/msys64/mingw64/lib/libpython3.8.dll.a (ver 3.8.9)
numpy: D:/msys64/mingw64/lib/python3.8/site-packages/numpy/core/include (ver 1.21.0)
install path: /registry/Lib/site-packages/cv2/python-3.8
Python (for build): D:/msys64/mingw64/bin/python3.exe
Java:
ant: NO
JNI: NO
Java wrappers: NO
Java tests: NO
Install to: D:/toolkit/opencv-4.5.1/build/install
-----------------------------------------------------------------
Configuring done
Generating done
I will be so thankful if you can help me solve the trouble!