ubuntu下,c++ 开发opencv,编译时没有报错, 运行时,发现报如下错
The library is compiled without QT support in function
原因是,安装编译时,未启用QT,报错如下
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.2.0) ~/opencv-4.2.0/opencv/modules/highgui/src/window.cpp:597: error: (-213:The function/feature is not implemented) The library is compiled without QT support in function 'createButton'
解决办法,重新安装编译opencv
sudo cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=ON \
-D WITH_GTK=ON \
-D WITH_OPENGL=ON \
-D WITH_VTK=ON \
-D OPENCV_GENERATE_PKGCONFIG=YES