# Revision history [back]

### How do I set up Qt windows for OpenCV in Ubuntu ?

Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version :

Ubuntu 18.04.4 LTS
OpenCV version : 4.2.0


In the book whenever they use imshow(), it shows a windows with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes :

sudo apt-get install qtcreator
sudo apt-get install qt5-default


Now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs ? Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

### How do I set up Qt windows for OpenCV in Ubuntu ?

Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version :

Ubuntu 18.04.4 LTS
OpenCV version : 4.2.0


In the book whenever they use imshow(), it shows a windows with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes :

sudo apt-get install qtcreator
sudo apt-get install qt5-default


Now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs ? I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

### How do I set up Qt windows for OpenCV in Ubuntu ?

Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version :

Ubuntu 18.04.4 LTS
OpenCV version : 4.2.0


In the book whenever they use imshow(), it shows a windows with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes :

sudo apt-get install qtcreator
sudo apt-get install qt5-default


Now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

### How do I set up Qt windows for OpenCV in Ubuntu ?

Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version :

Ubuntu 18.04.4 LTS
OpenCV version : 4.2.0


In the book whenever they use imshow(), it shows a windows window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes :

sudo apt-get install qtcreator
sudo apt-get install qt5-default


Now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

### How do I set up Qt windows for OpenCV in Ubuntu ?

Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version :

Ubuntu 18.04.4 LTS
OpenCV version : 4.2.0


In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes :

sudo apt-get install qtcreator
sudo apt-get install qt5-default


Now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error :

The library is compiled without QT support in function


I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

### How do I set up Qt windows for OpenCV in Ubuntu ?

Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version :

Ubuntu 18.04.4 LTS
OpenCV version : 4.2.0


In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes :

sudo apt-get install qtcreator
sudo apt-get install qt5-default


Now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error :

The library is compiled without QT support in function


I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

UPDATE

Apparently there was no other way beside completely uninstall OpenCV and the compile & reinstalling it with QT. This is what I do :

1. Uninstall OpenCV

sudo apt-get purge '*opencv*'
sudo find / -name "*opencv*" -exec rm -rf {} \;

2. Cloning OpenCV and OpenCV contrib from Github, and during building with CMake, put WITH_QT = ON. here's the full set up that I used :

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D WITH_TBB = ON \
-D WITH_V4L= ON \
-D WITH_QT = ON \
-D WITH_OPENGL = ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..


And when I checked my Qt version, this is what I got :

$qmake --version QMake version 3.1 Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu  But why does I still get error : The library is compiled without QT support in function  Any advice ? ### How do I set up Qt windows for OpenCV in Ubuntu ? Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version : Ubuntu 18.04.4 LTS OpenCV version : 4.2.0  In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes : sudo apt-get install qtcreator sudo apt-get install qt5-default  Now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error : The library is compiled without QT support in function  I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ? UPDATE Apparently there was no other way beside completely uninstall OpenCV and the then compile & reinstalling it with QT. This is what I do : 1. Uninstall OpenCV sudo apt-get purge '*opencv*' sudo find / -name "*opencv*" -exec rm -rf {} \;  2. Cloning OpenCV and OpenCV contrib from Github, and during building with CMake, put WITH_QT = ON. here's the full set up that I used : cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_GENERATE_PKGCONFIG=ON \ -D WITH_TBB = ON \ -D WITH_V4L= ON \ -D WITH_QT = ON \ -D WITH_OPENGL = ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \ -D BUILD_EXAMPLES=ON ..  And when I checked my Qt version, this is what I got : $ qmake --version
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu


But why does I still get error :

The library is compiled without QT support in function


### How do I set up Qt windows for OpenCV in Ubuntu ?

Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version :

Ubuntu 18.04.4 LTS
OpenCV version : 4.2.0


In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes :

sudo apt-get install qtcreator
sudo apt-get install qt5-default


Now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error :

The library is compiled without QT support in function


I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

UPDATE

Apparently there was no other way beside completely uninstall OpenCV and then compile & reinstalling it with QT. This is what I do :

1. Uninstall OpenCV

sudo apt-get purge '*opencv*'
sudo find / -name "*opencv*" -exec rm -rf {} \;

2. Cloning OpenCV and OpenCV contrib from Github, and during building with CMake, put WITH_QT = ON. here's the full set up that I used :

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D WITH_TBB = ON WITH_TBB=ON \
-D WITH_V4L= ON WITH_V4L=ON \
-D WITH_QT = ON WITH_QT=ON \
-D WITH_OPENGL = ON WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..


And when I checked my Qt version, this is what I got :

$qmake --version QMake version 3.1 Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu  But why does I still get error : The library is compiled without QT support in function  Any advice ? ### How do I set up Qt windows for OpenCV in Ubuntu ? Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version : Ubuntu 18.04.4 LTS OpenCV version : 4.2.0  In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes : sudo apt-get install qtcreator sudo apt-get install qt5-default  Now And when I checked my Qt version, this is what I got : $ qmake --version
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu


So, now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error :

The library is compiled without QT support in function


I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

UPDATE

Apparently there was no other way beside completely uninstall OpenCV and then compile & reinstalling it with QT. This is what I do :

1. Uninstall OpenCV

sudo apt-get purge '*opencv*'
sudo find / -name "*opencv*" -exec rm -rf {} \;

2. Cloning OpenCV and OpenCV contrib from Github, and during building with CMake, put WITH_QT = ON. here's the full set up that I used :

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..


And when I checked my Qt version, this is what I got :

$qmake --version QMake version 3.1 Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu  But why does I still get error : The library is compiled without QT support in function  Any advice ? ### How do I set up Qt windows for OpenCV in Ubuntu ? Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version : Ubuntu 18.04.4 LTS OpenCV version : 4.2.0  In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes : sudo apt-get install qtcreator sudo apt-get install qt5-default  And when I checked my Qt version, this is what I got : $ qmake --version
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu


So, now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error :

The library is compiled without QT support in function


I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

UPDATE

Apparently there was no other way beside completely uninstall OpenCV and then compile & reinstalling it with QT. This is what I do :

1. Uninstall OpenCV

sudo apt-get purge '*opencv*'
sudo find / -name "*opencv*" -exec rm -rf {} \;

2. Cloning OpenCV and OpenCV contrib from Github, and during building with CMake, put WITH_QT = ON. here's the full set up that I used :

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..


But why does I still get error after I rebuild and make my file :

The library is compiled without QT support in function


### How do I set up Qt windows for OpenCV in Ubuntu ?

Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version :

Ubuntu 18.04.4 LTS
OpenCV version : 4.2.0


In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes :

sudo apt-get install qtcreator
sudo apt-get install qt5-default


And when I checked my Qt version, this is what I got :

$qmake --version QMake version 3.1 Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu  So, now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error : The library is compiled without QT support in function  I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ? UPDATE Apparently there was no other way beside completely uninstall OpenCV and then compile & reinstalling it with QT. This is what I do : 1. Uninstall OpenCVOpenCV (already reinstalled 3 times) sudo apt-get purge '*opencv*' sudo find / -name "*opencv*" -exec rm -rf {} \;  2. Cloning OpenCV and OpenCV contrib from Github, and during building with CMake, put WITH_QT = ON. here's the full set up that I used : cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_GENERATE_PKGCONFIG=ON \ -D WITH_TBB=ON \ -D WITH_V4L=ON \ -D WITH_QT=ON \ -D WITH_OPENGL=ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \ -D BUILD_EXAMPLES=ON ..  But why does I still get error after I rebuild and make my file : The library is compiled without QT support in function  Any advice ? ### How do I set up Qt windows for OpenCV in Ubuntu ? Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version : Ubuntu 18.04.4 LTS OpenCV version : 4.2.0  In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes : sudo apt-get install qtcreator sudo apt-get install qt5-default  And when I checked my Qt version, this is what I got : $ qmake --version
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu


So, now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error :

The library is compiled without QT support in function


I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

UPDATE

Apparently there was no other way beside completely uninstall OpenCV and then compile & reinstalling it with QT. This is what I do :

1. Uninstall OpenCV (already reinstalled 3 times)

sudo apt-get purge '*opencv*'
sudo find / -name "*opencv*" -exec rm -rf {} \;

2. Cloning OpenCV and OpenCV contrib from Github, and during building with CMake, put WITH_QT = ON. here's the full set up that I used :

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..


But why does I still get this error even after I rebuild entirely reinstall, build and make my file : OpenCV with WITH_QT=ON ? Did CMake failed to locate QT ?

The library is compiled without QT support in function


UPDATE 2

I read about explicit path definition for Qt integration instead of just putting " WITH_QT=ON ". So I decided to go with cmake-gui and defined each path for Qt path configuration. Like this :

WITH_QT=ON (checked in cmake-gui)
Qt5Concurrent_DIR = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Concurrent
Qt5Core_DIR       = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Core
Qt5Gui_DIR        = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Gui
Qt5OpenGL_DIR     = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5OpenGL
Qt5Test_DIR       = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Test
Qt5Widgets_DIR    = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Widgets
Qt5_DIR           = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5


(Qt installation folowing installation docs from Qt Wiki)

Again, OpenCV was build & installed perfectly with CMake. Tested by running simple programs. But still encounter the same error for Qt. Any advice ? Thank you.

### How do I set up Qt windows for OpenCV in Ubuntu ?

Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version :

Ubuntu 18.04.4 LTS
OpenCV version : 4.2.0


In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes :

sudo apt-get install qtcreator
sudo apt-get install qt5-default


And when I checked my Qt version, this is what I got :

$qmake --version QMake version 3.1 Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu  So, now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error : The library is compiled without QT support in function  I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ? UPDATE Apparently there was no other way beside completely uninstall OpenCV and then compile & reinstalling it with QT. This is what I do : 1. Uninstall OpenCV (already reinstalled 3 times) sudo apt-get purge '*opencv*' sudo find / -name "*opencv*" -exec rm -rf {} \;  2. Cloning OpenCV and OpenCV contrib from Github, and during building with CMake, put WITH_QT = ON. here's the full set up that I used : cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_GENERATE_PKGCONFIG=ON \ -D WITH_TBB=ON \ -D WITH_V4L=ON \ -D WITH_QT=ON \ -D WITH_OPENGL=ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \ -D BUILD_EXAMPLES=ON ..  But why does I still get this error even after I entirely reinstall, build and make OpenCV with WITH_QT=ON ? Did CMake failed to locate QT ? The library is compiled without QT support in function  Any advice ? UPDATE 2 I read about explicit path definition for Qt integration instead of just putting " WITH_QT=ON ". WITH_QT=ON. So I decided to go with cmake-gui and defined each path for Qt path configuration. Like this : WITH_QT=ON (checked in cmake-gui) Qt5Concurrent_DIR = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Concurrent Qt5Core_DIR = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Core Qt5Gui_DIR = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Gui Qt5OpenGL_DIR = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5OpenGL Qt5Test_DIR = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Test Qt5Widgets_DIR = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Widgets Qt5_DIR = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5  (Qt installation folowing installation docs from Qt Wiki) Again, OpenCV was build & installed perfectly with CMake. Tested by running simple programs. But still encounter the same error for Qt. Any advice ? Thank you. ### How do I set up Qt windows for OpenCV in Ubuntu ? Hi, I've been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I'm working with OpenCV & C++ on a terminal and compile my program with CMake. Here's my Ubuntu & OpenCV version : Ubuntu 18.04.4 LTS OpenCV version : 4.2.0  In the book whenever they use imshow(), it shows a window with a toolbar and status bar on it, mine is not. And later on the next few chapters, they still use this toolbar for many purposes. After searching for a while, I found out that it is using Qt GUI. So, I went on to install Qt using these following codes : sudo apt-get install qtcreator sudo apt-get install qt5-default  And when I checked my Qt version, this is what I got : $ qmake --version
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu


So, now I have Qt installed in my machine, but how do I integrate this with my OpenCV so I can use it on my programs other than putting highgui lib ? I encountered this error :

The library is compiled without QT support in function


I've been looking around online but still don't know how. Do I need to entirely uninstall OpenCV and compile it again with QT using CMake ?

UPDATE

Apparently there was no other way beside completely uninstall OpenCV and then compile & reinstalling it with QT. This is what I do :

1. Uninstall OpenCV (already reinstalled 3 times)

sudo apt-get purge '*opencv*'
sudo find / -name "*opencv*" -exec rm -rf {} \;

2. Cloning OpenCV and OpenCV contrib from Github, and during building with CMake, put WITH_QT = ON. here's the full set up that I used :

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..


But why does I still get this error on any project with QT on it (I have QT properties on my createButton function) even after I entirely reinstall, build and make OpenCV with WITH_QT=ON using WITH_QT=ON ? Did Does CMake failed to locate QT ?? Here's the full exeption :

terminate called after throwing an instance of 'cv::Exception' what():
OpenCV(4.2.0-dev) /home/raisa/opencv_build/opencv/modules/highgui/src/window.cpp:597:
error: (-213:The function/feature is not implemented)
The library is compiled without QT support in function
function 'createButton'

[2]    10467 abort (core dumped)  ./exerc13


Here's the function createButton that causing error

//Create buttons
createButton("Blur",  blurCallback,  NULL, QT_CHECKBOX, 0);
createButton("Sobel", sobelCallback, NULL, QT_PUSH_BUTTON, 0);


Literally just because I have QT properties there and it's causing error "The library is compiled without QT support". Any advice ?

UPDATE 2

I read about explicit path definition for Qt integration instead of just putting WITH_QT=ON. So I decided to go with cmake-gui and defined each path for Qt path configuration. Like this :

WITH_QT=ON (checked in cmake-gui)
Qt5Concurrent_DIR = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Concurrent
Qt5Core_DIR       = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Core
Qt5Gui_DIR        = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Gui
Qt5OpenGL_DIR     = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5OpenGL
Qt5Test_DIR       = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Test
Qt5Widgets_DIR    = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5Widgets
Qt5_DIR           = /home/raisa/Qt5.9.9/5.9.9/gcc_64/lib/cmake/Qt5


(Qt installation folowing installation docs from Qt Wiki)

Again, OpenCV was build & installed perfectly with CMake. Tested by running simple programs. But still encounter the same error for Qt. Any advice ? Thank you.