简体   繁体   中英

QtOpenGL: No such file or directory opencv python

when i use make commande i get this error

[ 24%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_QT.cpp.o
In file included from /home/sharkawey/op/opencv-master/modules/highgui/src/window_QT.cpp:47:0:
/home/sharkawey/op/opencv-master/modules/highgui/src/window_QT.h:46:20: fatal error: QtOpenGL: No such file or directory
 #include <QtOpenGL>
                    ^
compilation terminated.
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_QT.cpp.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2

i used this command to compile opencv

 cmake -D CMAKE_BUILD_TYPE=RELEASE -D INSTALL_C_EXAMPLES=ON  

        -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON

        -D WITH_QT=ON -D CMAKE_INSTALL_PREFIX=/usr/local

        -D WITH_OPENGL=ON -D WITH_V4L=ON

        -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_TBB=ON ..

but the proplem still here

您需要安装缺少的依赖关系,可以通过以下方法完成:

sudo apt-get install libqt5opengl5 libqt5opengl5-dev

Are you sure you added your Qt folder to your path? Anyway, doing some change like these should help:

  1. Go to path ' /home/sharkawey/op/opencv-master/modules/highgui/src/ '.
  2. Open file ' window_QT.h ' with your editor.
  3. Change the following line:

#include <QtOpenGL>

into:

#include <fullpath/QtOpenGL>

Replace the 'fullpath' string with your actual path of QtOpenGL. You can find it using find command. For instance, if your QtOpenGL is located under ' /home/usr/Qt/ ', you should write as:

#include </home/usr/Qt/QtOpenGL>

Then your compiler knows where to find it. I believe for your case, you may encounter same situations for other files too, and you can solve them similarly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM