Ask Your Question

Revision history [back]

Error during compiling OpenCV with CMake using Qt MinGW

Hello All,

I am trying to compile OpenCV 3.4.1 with CMake 3.11.3 using Qt5.11 MinGW on windows 10 but it gives me error when i try to generate in Cmake. I would like to use openCV libraries in Qt 5.11.

I followed the following steps mentioned here. Following is the debug output:

CUDA compilation is disabled (due to only Visual Studio compiler supported on your platform).
Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
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
Excluding from source files list: modules/core/src/convert.avx2.cpp
Excluding from source files list: modules/imgproc/src/filter.avx2.cpp
Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
Excluding from source files list: modules/imgproc/src/undistort.avx2.cpp
Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx2.cpp
Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp
Excluding from source files list: modules/features2d/src/fast.avx2.cpp

General configuration for OpenCV 3.4.1 =====================================
Version control:               unknown

Platform:
Timestamp:                   2018-06-12T13:40:31Z
Host:                        Windows 10.0.17134 AMD64
CMake:                       3.11.3
CMake generator:             MinGW Makefiles
CMake build tool:            C:/Qt/Tools/mingw530_32/bin/mingw32-make.exe
Configuration:               Release

CPU/HW features:
Baseline:                    SSE SSE2
  requested:                 SSE2
Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX
  requested:                 SSE4_1 SSE4_2 AVX FP16
  SSE4_1 (3 files):          + SSE3 SSSE3 SSE4_1
  SSE4_2 (1 files):          + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2
  FP16 (2 files):            + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
  AVX (5 files):             + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVX

C/C++:
Built as dynamic libs?:      YES
C++ Compiler:                C:/Qt/Tools/mingw530_32/bin/g++.exe  (ver 5.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 -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -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 -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG

C Compiler:                  C:/Qt/Tools/mingw530_32/bin/gcc.exe
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-narrowing -Wno-comment -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -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-narrowing -Wno-comment -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG

Linker flags (Release):      -Wl,--gc-sections  
Linker flags (Debug):        -Wl,--gc-sections  
ccache:                      NO
Precompiled headers:         YES
Extra dependencies:          opengl32 glu32
3rdparty dependencies:

OpenCV modules:
To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc java_bindings_generator ml objdetect photo python_bindings_generator shape stitching superres ts video videoio videostab
Disabled:                    js world
Disabled by dependency:      -
Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz
Applications:                tests perf_tests apps
Documentation:               NO
Non-free algorithms:         NO

Windows RT support:            NO

GUI: 
QT:                          YES (ver 5.11.0)
  QT OpenGL support:         YES (Qt5::OpenGL 5.11.0)
Win32 UI:                    YES
OpenGL support:              YES (opengl32 glu32)
VTK support:                 NO

Media I/O: 
ZLib:                        build (ver 1.2.11)
JPEG:                        build (ver 90)
WEBP:                        build (ver encoder: 0x020e)
PNG:                         build (ver 1.6.34)
TIFF:                        build (ver 42 - 4.0.9)
JPEG 2000:                   build (ver 1.900.1)
OpenEXR:                     build (ver 1.7.1)

Video I/O:
Video for Windows:           YES
DC1394:                      NO
FFMPEG:                      YES (prebuilt binaries)
  avcodec:                   YES (ver 57.107.100)
  avformat:                  YES (ver 57.83.100)
  avutil:                    YES (ver 55.78.100)
  swscale:                   YES (ver 4.8.100)
  avresample:                YES (ver 3.7.0)
GStreamer:                   NO
DirectShow:                  YES

Parallel framework:            none

Trace:                         YES (built-in)

Other third-party libraries:
Lapack:                      NO
Eigen:                       NO
Custom HAL:                  NO
Protobuf:                    build (3.5.1)

NVIDIA CUDA:                   NO

OpenCL:                        YES (no extra features)
Include path:                C:/opencv/sources/3rdparty/include/opencl/1.2
Link libraries:              Dynamic load

Python (for build):            C:/Python27/python.exe

Java:                          
ant:                         NO
JNI:                         NO
Java wrappers:               NO
Java tests:                  NO

Matlab:                        YES
mex:                         C:/Program Files (x86)/MATLAB/MATLAB Production Server/R2015a/bin/mex.bat
Compiler/generator:          Not working (bindings will not be generated)

Install to:                    C:/opencv/Release/install
-----------------------------------------------------------------

Configuring done
CMake Error in modules/highgui/CMakeLists.txt:
No known features for CXX compiler

"GNU"

version 5.3.0.

Could anyone please help me with the compilation?

Thank you for your time and knowledge.