2

I am trying to install openCV for C++ on ubuntu. I am using this document . But step of compilation fails. The log of make is as follow:

$make
[  0%] Built target opencv_core_pch_dephelp
[  0%] Built target pch_Generate_opencv_core
[  3%] Built target opencv_core
[  4%] Built target opencv_ts_pch_dephelp
[  4%] Built target pch_Generate_opencv_ts
[  4%] Built target opencv_flann_pch_dephelp
[  5%] Built target pch_Generate_opencv_flann
[  5%] Built target opencv_flann
[  5%] Built target opencv_imgproc_pch_dephelp
[  5%] Built target pch_Generate_opencv_imgproc
[  9%] Built target opencv_imgproc
[  9%] Automoc for target opencv_highgui
[  9%] Built target opencv_highgui_automoc
[  9%] Automoc for target opencv_highgui_pch_dephelp
[  9%] Built target opencv_highgui_pch_dephelp_automoc
[  9%] Built target opencv_highgui_pch_dephelp
[  9%] Built target pch_Generate_opencv_highgui
[  9%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir /src/window_QT.cpp.o
In file included from /home/src/OpenCV/opencv-2.4.13/modules/highgui/src/window_QT.cpp:47:0:
/home/src/OpenCV/opencv-2.4.13/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

Could you please help me to fix this compilation problem?

Feten Besbes
  • 186
  • 1
  • 10

1 Answers1

1

I avoided the compilation error by runnuing:

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_QT=ON -D WITH_OPENGL=ON ..

Instead of :

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
Feten Besbes
  • 186
  • 1
  • 10
  • I also installed these two packages : libqt5opengl5 libqt5opengl5-dev. (reference: to http://stackoverflow.com/questions/31538560/qtopengl-no-such-file-or-directory-opencv-python) – Feten Besbes Nov 22 '16 at 15:35