# QGLWidget not found when compiling OpenCV on Manjaro

**URL:** https://forum.opencv.org/t/qglwidget-not-found-when-compiling-opencv-on-manjaro/6459
**Category:** C++
**Tags:** highgui, qt, build
**Created:** [November 28, 2021, 8:20pm UTC](https://forum.opencv.org/t/qglwidget-not-found-when-compiling-opencv-on-manjaro/6459 "2021-11-28T20:20:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rickiewars](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@rickiewars](https://forum.opencv.org/u/rickiewars)
#### Post date: [November 28, 2021, 8:20pm UTC](https://forum.opencv.org/t/qglwidget-not-found-when-compiling-opencv-on-manjaro/6459/1 "2021-11-28T20:20:11Z")

</div>

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:

```auto
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!

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [November 30, 2021, 12:24pm UTC](https://forum.opencv.org/t/qglwidget-not-found-when-compiling-opencv-on-manjaro/6459/2 "2021-11-30T12:24:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![rickiewars](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@rickiewars](https://forum.opencv.org/u/rickiewars)
#### Post date: [November 30, 2021, 1:13pm UTC](https://forum.opencv.org/t/qglwidget-not-found-when-compiling-opencv-on-manjaro/6459/3 "2021-11-30T13:13:51Z")

</div>

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!
