I am trying to install OpenCV 2.4.2 on Ubuntu and am confusing errors as shown below:
[ 11%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o In file included from /usr/local/include/glib-2.0/glib/gasyncqueue.h:30:0, from /usr/local/include/glib-2.0/glib.h:32, from /usr/local/include/gtk-2.0/gdk/gdktypes.h:32, from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:4, from /usr/local/include/gtk-2.0/gdk/gdk.h:30, from /usr/local/include/gtk-2.0/gtk/gtk.h:31, from /opt/opencv/OpenCV-2.4.2/modules/highgui/src/window_gtk.cpp:48: /usr/local/include/glib-2.0/glib/gthread.h:233:27: error: variable or field 'g_static_mutex_init' declared void /usr/local/include/glib-2.0/glib/gthread.h:233:27: error: 'GStaticMutex' was not declared in this scope /usr/local/include/glib-2.0/glib/gthread.h:233:41: error: 'mutex' was not declared in this scope /usr/local/include/glib-2.0/glib/gthread.h:233:41: note: suggested alternative: /usr/include/tbb/mutex.h:48:7: note: 'tbb::mutex'
I checked all the dependencies and installed them as shown below:
sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev
I also added the following paths to CMakeCache.txt
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include/
Any help is appreciated.
Thanks,
Sid
Edit: I switched to QT according to the comment and let me get rid of gtk by including in it what I had to manually insert into CMakeCache.txt. But I was still getting the installation error (possibly due to glib being turned on), so I disabled GSTREAMER in CMAKE, and now I can install opencv. Is this work possible?
source share