0

In opencv compilation, we need gtk. I have gtk-2.0 and gtk-3.0 installed. This command gave me

 dpkg -l libgtk2.0-0 libgtk-3-0

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  libgtk-3-0:amd 3.10.8-0ubun amd64        GTK+ graphical user interface lib
ii  libgtk2.0-0:am 2.24.23-0ubu amd64        GTK+ graphical user interface lib
ii  libgtk2.0-0:i3 2.24.23-0ubu i386         GTK+ graphical user interface lib

I have gtk-2.0 and gtk-3.0 folder inside /usr/include/. They exist as /usr/include/gtk-2.0 and /usr/include/gtk-3.0

But my compilation for opencv gave me error as

src/window_gtk.cpp:48:21: fatal error: gtk/gtk.h: No such file or directory
 #include "gtk/gtk.h"
                     ^
compilation terminated.

I have gtk/gtk.h inside both gtk-2.0 and gtk-3.0 folders. What could be wrong?

batuman
  • 7,066
  • 26
  • 107
  • 229

1 Answers1

0

First, use brackets instead of double quotes searches in your include if that's not a file that belongs to your project, but a third-party one.

We also need to know which version of opencv you're trying to compile. OpenCV 2.x support GTK+ 2 only, whereas OpenCV 3.x support GTK+ 3.

We also need how you call cmake when you configure the OpenCV project, so please add the command line and the logs of that call too.

This will help determine the arguments given to the compiler, to check it uses the right include locations, and also check that it's trying to use the GTK+ backend and not the Qt one for example.

liberforce
  • 11,189
  • 37
  • 48