Opencv安装编译时,未启用QT的问题

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
发布了132 篇原创文章 · 获赞 7 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/youlinhuanyan/article/details/104380411