Ask Your Question

Revision history [back]

Compiling opencv2.4.9 on ubuntu14.04 WITH_QT=ON fails

Hi.

My build fails when compiling opencv2.4.9 with the following cmake

cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_VTK=ON ..

if I compile WITH_QT=OFF everything is fine

I Get this

In file included from /home/vccdemo/Downloads/opencv-2.4.9/build/modules/highgui/opencv_highgui_automoc.cpp:2:0: /home/vccdemo/Downloads/opencv-2.4.9/build/modules/highgui/moc_window_QT.cpp:13:2: error: #error "This file was generated using the moc from 4.8.6. It" #error "This file was generated using the moc from 4.8.6. It" ^ /home/vccdemo/Downloads/opencv-2.4.9/build/modules/highgui/moc_window_QT.cpp:14:2: error: #error "cannot be used with the include files from this version of Qt." #error "cannot be used with the include files from this version of Qt." ^ /home/vccdemo/Downloads/opencv-2.4.9/build/modules/highgui/moc_window_QT.cpp:15:2: error: #error "(The moc has changed too much.)" #error "(The moc has changed too much.)"

.. .. ..

dow::metaObject() const’: /home/vccdemo/Downloads/opencv-2.4.9/build/modules/highgui/moc_window_QT.cpp:646:1: error: control reaches end of non-void function [-Werror=return-type] } ^ /home/vccdemo/Downloads/opencv-2.4.9/build/modules/highgui/moc_window_QT.cpp: In member function ‘virtual const QMetaObject* DefaultViewPort::metaObject() const’: /home/vccdemo/Downloads/opencv-2.4.9/build/modules/highgui/moc_window_QT.cpp:742:1: error: control reaches end of non-void function [-Werror=return-type] }

cc1plus: some warnings being treated as errors make[2]: * [modules/highgui/CMakeFiles/opencv_highgui.dir/opencv_highgui_automoc.cpp.o] Error 1 make[1]: [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2 make: ** [all] Err

-- VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.5.8.0 + Qt4

-- Found VTK ver. 5.8.0 (usefile: /usr/lib/vtk-5.8/UseVTK.cmake)

-- General configuration for OpenCV 2.4.9 =====================================

-- Version control: unknown

-- Platform: -- Host: Linux 3.13.0-40-generic x86_64 -- CMake: 2.8.12.2 -- CMake generator: Unix Makefiles -- CMake build tool: /usr/bin/make

-- Configuration: Release

-- C/C++: -- Built as dynamic libs?: YES -- C++ Compiler: /usr/bin/c++ (ver 4.8.2) -- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG -- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -- C Compiler: /usr/bin/cc -- 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 -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -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 -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -- Linker flags (Release):
-- Linker flags (Debug):

-- Precompiled headers: YES

-- OpenCV modules: -- To be built: core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib java python stitching superres ts videostab viz -- Disabled: world -- Disabled by dependency: -

-- Unavailable: androidcamera dynamicuda

-- GUI: -- QT 5.x: YES (ver 5.1.1) -- QT OpenGL support: YES (Qt5::OpenGL 5.1.1) -- OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so)

-- VTK support: YES (ver 5.8.0)

-- 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 ) -- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.50) -- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.3) -- JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)

-- OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 1.6.1)

-- Video I/O: -- DC1394 1.x: NO -- DC1394 2.x: YES (ver 2.2.1) -- FFMPEG: YES -- codec: YES (ver 54.35.0) -- format: YES (ver 54.20.4) -- util: YES (ver 52.3.0) -- swscale: YES (ver 2.1.1) -- gentoo-style: YES -- GStreamer:
-- base: YES (ver 0.10.36) -- app: YES (ver 0.10.36) -- video: YES (ver 0.10.36) -- OpenNI: NO -- OpenNI PrimeSensor Modules: NO -- PvAPI: NO -- GigEVisionSDK: NO -- UniCap: NO -- UniCap ucil: NO -- V4L/V4L2: Using libv4l (ver 1.0.1) -- XIMEA: NO

-- Xine: NO

-- Other third-party libraries: -- Use IPP: NO -- Use Eigen: YES (ver 3.2.0) -- Use TBB: YES (ver 4.2 interface 7000) -- Use OpenMP: NO -- Use GCD NO -- Use Concurrency NO -- Use C=: NO -- Use Cuda: NO

-- Use OpenCL: YES

-- OpenCL: -- Version: dynamic -- Include path: /home/vccdemo/Downloads/opencv-2.4.9/3rdparty/include/opencl/1.2 -- Use AMD FFT: NO

-- Use AMD BLAS: NO

-- Python: -- Interpreter: /usr/bin/python2 (ver 2.7.6) -- Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6) -- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2)

-- packages path: lib/python2.7/dist-packages

-- Java: -- ant: /usr/bin/ant (ver 1.9.3) -- JNI: /usr/lib/jvm/java-8-oracle/include /usr/lib/jvm/java-8-oracle/include/linux /usr/lib/jvm/java-8-oracle/include

-- Java tests: YES

-- Documentation: -- Build Documentation: YES -- Sphinx: /usr/bin/sphinx-build (ver 1.2.2)

-- PdfLaTeX compiler: /usr/bin/pdflatex

-- Tests and samples: -- Tests: YES -- Performance tests: YES

-- C/C++ Examples: YES

-- Install path: /usr/local

-- cvconfig.h is in: /home/vccdemo/Downloads/opencv-2.4.9/build

-- -----------------------------------------------------------------

-- Configuring done -- Generating done -- Build files have been written to: /home/vccdemo/Downloads/opencv-2.4.9/build