Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The library is compiled without QT support in function createButton? #11372

Closed
yjdwbj opened this issue Apr 23, 2018 · 4 comments
Closed

The library is compiled without QT support in function createButton? #11372

yjdwbj opened this issue Apr 23, 2018 · 4 comments
Labels
question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org

Comments

@yjdwbj
Copy link

yjdwbj commented Apr 23, 2018

Hi all!
recently I'm used opencv3 got a problem as blow.

Test example Code

#include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>

using namespace std;
using namespace cv;

void blurCallback(int state, void* userdata);

void blurCallback(int state, void* userdata)
{

}

int main(int argc, char *argv[])
{


     Mat img=  imread("imgs/1.jpg");
     namedWindow("test",WINDOW_AUTOSIZE);

     createButton("Blur",blurCallback);
     imshow("test",img);
     cerr << cv::getBuildInformation();
     waitKey(0);

    return 0;
}
michael@debian:~/3TB-DISK/workspace/cmake_opencv3/build$ ./cmake_opencv3 
OpenCV Error: The function/feature is not implemented (The library is compiled without QT support) in createButton, file /home/michael/opencv-3.0.0/modules/highgui/src/window.cpp, line 478
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/michael/opencv-3.0.0/modules/highgui/src/window.cpp:478: error: (-213) The library is compiled without QT support in function createButton

Aborted

System information (version)
  • OpenCV => 3.4.1
  • Operating System / Platform => Linux debian 4.13.13-20170715 Fixes #1 SMP Thu Nov 16 21:04:42 CST 2017 x86_64 GNU/Linux
  • Compiler => CMake 3.7.2
  • Qt => 5.7.0

Building Script

michael@debian:~/3TB-DISK/SOFT-LIBRAR/opencv-3.4.1/build-qt5$  cmake -DCMAKE_PREFIX_PATH=/home/michael/IDE_DIR/Qt5.7/5.7/gcc_64   -D CMAKE_INSTALL_PREFIX=/home/michael/3TB-DISK/SOFT-LIBRAR/opencv-build-3.x-qt5   -D WITH_QT=ON -D WITH_V4L=ON -D BUILD_TESTS=OFF -D WITH_TBB=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON   -D WITH_OPENMP=ON -D WITH_OPENEXR=ON -D WITH_UNICAP=ON -D BUILD_PYTHON_SUPPORT=ON  -D WITH_GTK_3_X=OFF  -D WITH_GTK_2_X=OFF   -D WITH_OPENGL=ON ../
...

-- General configuration for OpenCV 3.4.1 =====================================
--   Version control:               unknown
-- 
--   Platform:
--     Timestamp:                   2018-04-23T03:04:08Z
--     Host:                        Linux 4.13.13-20170715 x86_64
--     CMake:                       3.7.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 (3 files):          + SSSE3 SSE4_1
--       SSE4_2 (1 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 (9 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--       AVX512_SKX (1 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_SKX
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++11:                       YES
--     C++ Compiler:                /usr/bin/c++  (ver 6.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 -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -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 -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -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-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fopenmp -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 -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fopenmp -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      
--     Linker flags (Debug):        
--     ccache:                      NO
--     Precompiled headers:         YES
--     Extra dependencies:          dl m pthread rt /usr/lib/x86_64-linux-gnu/libGLU.so /usr/local/lib/libGL.so
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc java_bindings_generator ml objdetect photo python2 python_bindings_generator shape stitching superres ts video videoio videostab viz
--     Disabled:                    js world
--     Disabled by dependency:      -
--     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python3
--     Applications:                perf_tests apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI: 
--     QT:                          YES (ver 5.7.0)
--       QT OpenGL support:         YES (Qt5::OpenGL 5.7.0)
--     GTK+:                        NO
--     OpenGL support:              YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/local/lib/libGL.so)
--     VTK support:                 YES (ver 6.3.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 )
--     WEBP:                        /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x0209)
--     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.28)
--     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.0.8)
--     JPEG 2000:                   /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
-- 
--   Video I/O:
--     DC1394:                      NO
--     FFMPEG:                      YES
--       avcodec:                   YES (ver 57.89.100)
--       avformat:                  YES (ver 57.71.100)
--       avutil:                    YES (ver 55.58.100)
--       swscale:                   YES (ver 4.6.100)
--       avresample:                YES (ver 3.5.0)
--     GStreamer:                   NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     libv4l/libv4l2:              NO
--     v4l/v4l2:                    linux/videodev.h linux/videodev2.h
--     gPhoto2:                     YES
-- 
--   Parallel framework:            OpenMP
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Intel IPP:                   2017.0.3 [2017.0.3]
--            at:                   /home/michael/3TB-DISK/SOFT-LIBRAR/opencv-3.4.1/build-qt5/3rdparty/ippicv/ippicv_lnx
--     Intel IPP IW:                sources (2017.0.3)
--               at:                /home/michael/3TB-DISK/SOFT-LIBRAR/opencv-3.4.1/build-qt5/3rdparty/ippicv/ippiw_lnx
--     Lapack:                      NO
--     Eigen:                       YES (ver 3.3.2)
--     Custom HAL:                  NO
--     Protobuf:                    build (3.5.1)
-- 
--   NVIDIA CUDA:                   NO
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/michael/3TB-DISK/SOFT-LIBRAR/opencv-3.4.1/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 2:
--     Interpreter:                 /home/michael/.pyenv/shims/python2.7 (ver 2.7.13)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.13)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.12.1)
--     packages path:               lib/python2.7/dist-packages
-- 
--   Python (for build):            /home/michael/.pyenv/shims/python2.7
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         /home/michael/IDE_DIR/jdk1.8.0_112/include /home/michael/IDE_DIR/jdk1.8.0_112/include/linux /home/michael/IDE_DIR/jdk1.8.0_112/include
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Matlab:                        NO
-- 
--   Install to:                    /home/michael/3TB-DISK/SOFT-LIBRAR/opencv-build-3.x-qt5

ldd check link librarys

/home/michael/3TB-DISK/SOFT-LIBRAR/opencv-build-3.x-qt5/lib
michael@debian:~/3TB-DISK/SOFT-LIBRAR/opencv-build-3.x-qt5/lib$ ldd libopencv_highgui.so | grep "Qt"
	libQt5Test.so.5 => /home/michael/IDE_DIR/Qt5.7/5.7/gcc_64/lib/libQt5Test.so.5 (0x00007f40c86e0000)
	libQt5Concurrent.so.5 => /home/michael/IDE_DIR/Qt5.7/5.7/gcc_64/lib/libQt5Concurrent.so.5 (0x00007f40c84d8000)
	libQt5OpenGL.so.5 => /home/michael/IDE_DIR/Qt5.7/5.7/gcc_64/lib/libQt5OpenGL.so.5 (0x00007f40c8280000)
	libQt5Widgets.so.5 => /home/michael/IDE_DIR/Qt5.7/5.7/gcc_64/lib/libQt5Widgets.so.5 (0x00007f40c3c18000)
	libQt5Gui.so.5 => /home/michael/IDE_DIR/Qt5.7/5.7/gcc_64/lib/libQt5Gui.so.5 (0x00007f40c3470000)
	libQt5Core.so.5 => /home/michael/IDE_DIR/Qt5.7/5.7/gcc_64/lib/libQt5Core.so.5 (0x00007f40c2d50000)
	libicui18n.so.56 => /home/michael/IDE_DIR/Qt5.7/5.7/gcc_64/lib/libicui18n.so.56 (0x00007f40bb770000)
	libicuuc.so.56 => /home/michael/IDE_DIR/Qt5.7/5.7/gcc_64/lib/libicuuc.so.56 (0x00007f40bb3b8000)
	libicudata.so.56 => /home/michael/IDE_DIR/Qt5.7/5.7/gcc_64/lib/libicudata.so.56 (0x00007f40b99d0000)
@berak
Copy link
Contributor

berak commented Apr 23, 2018

/home/michael/opencv-3.0.0/modules/highgui/src/window.cpp:478: error: -- this is using the old 3.0.0 libs, not your newly build 3.4.1(with qt)

@zhouhao27
Copy link

How to use brew to install OpenCV with QT enabled?

@rotcx
Copy link

rotcx commented Feb 20, 2020

How to use brew to install OpenCV with QT enabled?

https://github.com/Homebrew/linuxbrew-core/blob/master/Formula/opencv@3.rb

args = std_cmake_args + %W[
  -DCMAKE_OSX_DEPLOYMENT_TARGET=
  -DBUILD_JASPER=ON
  -DBUILD_JPEG=ON
  -DBUILD_OPENEXR=ON
  -DBUILD_PERF_TESTS=ON
  -DBUILD_PNG=ON
  -DBUILD_TESTS=ON
  -DBUILD_TIFF=ON
  -DBUILD_ZLIB=ON
  -DBUILD_opencv_hdf=ON
  -DBUILD_opencv_java=ON
  -DBUILD_opencv_text=ON
  -DOPENCV_ENABLE_NONFREE=ON
  -DOPENCV_EXTRA_MODULES_PATH=#{buildpath}/opencv_contrib/modules
  -DWITH_1394=ON
  -DWITH_CUDA=ON
  -DWITH_EIGEN=ON
  -DWITH_FFMPEG=ON
  -DWITH_GPHOTO2=ON
  -DWITH_GSTREAMER=ON
  -DWITH_JASPER=ON
  -DWITH_OPENEXR=ON
  -DWITH_OPENGL=ON
  -DWITH_QT=ON
  -DWITH_TBB=ON
  -DWITH_VTK=ON
  -DBUILD_opencv_python2=ON
  -DBUILD_opencv_python3=ON
  -DPYTHON3_EXECUTABLE=#{which "python3"}
  -DPYTHON3_LIBRARY=#{py3_config}/libpython#{py3_version}.dylib
  -DPYTHON3_INCLUDE_DIR=#{py3_include}
]

brew install ./opencv@3.rb

@rotcx
Copy link

rotcx commented Feb 20, 2020

nevertheless the bug remained the same ...

fatal error:
'opencv2/viz.hpp' file not found
#include <opencv2/viz.hpp>
^~~~~~~~~~~~~~~~~
1 error generated.
The terminal process terminated with exit code: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org
Projects
None yet
Development

No branches or pull requests

5 participants