2015-07-21 135 views
1

當我使用使COMMANDE我得到這個錯誤QtOpenGL:沒有這樣的文件或目錄的OpenCV蟒蛇

[ 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 

我用這個命令來編譯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 .. 

但proplem還在這裏

回答

2

你確定你添加了你的Qt文件夾到你的路徑嗎? 總之,做一些像這樣的變化應該有所幫助:

  1. 轉到路徑「/home/sharkawey/op/opencv-master/modules/highgui/src/」。
  2. 用您的編輯器打開文件'window_QT.h'。
  3. 更改以下行:

#include <QtOpenGL>

到:

#include <fullpath/QtOpenGL> 

替換QtOpenGL的實際路徑 'FULLPATH' 字符串。你可以使用find命令找到它。舉例來說,如果你的QtOpenGL位於下「/home/usr/Qt/」,你應該寫:

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

那麼你的編譯器知道在哪裏可以找到它。我相信對於您的情況,您也可能遇到其他文件的相同情況,並且可以類似地解決它們。

+0

它仍然給我erorr我用QT5 – shar

+0

你收到一個不同的錯誤信息,或再次同一個?你確定你提供了正確的完整路徑嗎? – Derman

8

您需要安裝缺少的依賴關係,它可以這樣做:

sudo apt-get install libqt5opengl5 libqt5opengl5-dev 
+0

這解決了我的問題 –

相關問題