[英]QtOpenGL: No such file or directory opencv python
when i use make commande i get this error 当我使用make命令时,出现此错误
[ 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 我用这个命令来编译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? 您确定将Qt文件夹添加到路径了吗? Anyway, doing some change like these should help: 无论如何,进行如下更改应该会有所帮助:
/home/sharkawey/op/opencv-master/modules/highgui/src/
'. 转到路径“ /home/sharkawey/op/opencv-master/modules/highgui/src/
”。 window_QT.h
' with your editor. 使用编辑器打开文件“ window_QT.h
”。 #include <QtOpenGL>
into: 变成:
#include <fullpath/QtOpenGL>
Replace the 'fullpath' string with your actual path of QtOpenGL. 用您的QtOpenGL的实际路径替换'fullpath'字符串。 You can find it using find command. 您可以使用find命令找到它。 For instance, if your QtOpenGL
is located under ' /home/usr/Qt/
', you should write as: 例如,如果您的QtOpenGL
位于“ /home/usr/Qt/
”下,则应写为:
#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. 我相信对于您的情况,其他文件也可能遇到相同的情况,并且您可以类似地解决它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.