I’m trying to build OpenCV version 4.5.4 on my new Manjaro Linux installation. I’m trying to build it with QT support and the contrib addons.
Around 35% into the build I get the following error:
In file included from /home/rickiewars/git/.download/dev/opencv_packages/opencv/modules/highgui/src/window_QT.cpp:47:
/home/rickiewars/git/.download/dev/opencv_packages/opencv/modules/highgui/src/window_QT.h:51:10: fatal error: QGLWidget: No such file or directory
51 | #include <QGLWidget>
I’ve installed the qt5-base package with pacman and the include file can be found in /usr/include/qt/QtOpenGL/QGLWidget
I’ve changed the following variables in CMakeCache.txt:
-
WITH_OPENGL
→ ON
-
WITH_QT
→ ON
-
OPENCV_ENABLE_NONFREE
→ ON
-
BUILD_opencv_rgbd
→ OFF
-
OPENCV_ENABLE_ALLOCATOR_STATS
→ OFF
-
ENABLE_PRECOMPILED_HEADER
→ OFF
I hope someone can help me compile this before my next class begins.
My thanks in advance!
if you don’t specifically need the fancy Qt variant of imshow
, you can just build OpenCV without Qt, and it’ll use GTK or something. that’ll be a plain imshow without decorations.
I’d guess that your Qt is too new (or too old?) for the Qt highgui backend of OpenCV…
I see mention of deprecation of some headers where QGLWidget lives. the old header is called QtOpenGL
, the new one (for QGLWidget) is QGLWidget
from the error it looks like OpenCV includes the correct header… so I conclude that you have an ancient Qt? or it doesn’t find Qt in general, which would be a different problem.
Hi, thanks for the fast reply.
I needed the qt version because all of the examples i got from class are written with qt.
Fortunately i fixed all my problems by installing python-opencv on my system.
Looks like i was missing a dependancy or something.
Sorry for late response i’ve fixed my issue but i just saw the post was made visible, when i fixed my issue the post was still marked as hidden.
Thanks anyway!