I am trying to get Gtk+ working on my Beaglebone Black(armv7l GNU/Linux), very similar to a Raspberry Pi and just about got it except for the Bindings.
I am building the example here and got to the point
exampleappwindow.h
class ExampleAppWindow : public Gtk::ApplicationWindow {
...
Glib::RefPtr<Glib::Binding> m_prop_binding
}
I get a error:
no member named 'Binding' in namespace 'Glib'
I am developing on a Windows 10 pro system using VisualGDB to cross-compile and can't seem to be able to use pkg-config --cflags --libs gtkmm-3.0
anywhere, VisualGDB doesn't seem to know what to do with it so I had to go through and manually setup the libraries and includes off of the pkg-config command, maybe that has something to do with this.
I looked up the GLib::Bindings and found it is declared in libglibmm
so I thought I needed to install that separate but when I installed libglibmm2.4-dev
there still isn't GLib::Binding
or even glibmm/bindings.h
.
I did a search using find / -name *binding.h
and there was one file:
/usr/include/glib-2.0/gobject/gbinding.h
Is this this the base class for gtkmm's binding? I know that the libgtkmm is simply a C++ wrapper, do I need to add a pre-processor definition to include the correct headers?
Am I missing a library or is the Bindings part of the GLib not available for my distro? I am still pretty new at Linux and not sure how to find out whats included in one distro than the other.
I would think that just including #include <gtkmm.h>
would pull in everything, perhaps I need to explicitly include another library or tell Gtk+ what binding library to use?
Is there a setup step that I didn't do when I installed the gtkmm library? I installed the library using apt-get install libgtkmm-3.0-dev
I have done a little more work on this and found that the bindings are provided through the dbus-glib bindings. I am not sure if I need a specific version of GLib to enable the bindings or if I need to install another package all together. I have seen references to libdbus-glib2.0-cil so I installed the dev version but still nothing.
There is a command dbus-binding-tool
, am I supposed to run this command on a file to enable binding? There are references to this command but nothing on how it is supposed to be used.
After working on this for a couple of days now I think I came to the conclusion that as of the time of this answer that gtk+ support on the Beaglebone Black is not complete. There is a package dbus-glib-cli
that does provide binding support but isn't as easy because you have to create a schema file basically then run a compile tool to generate a binding header, very close to how c++ xml binding libraries accomplish.
As I understand it a better approach is to move away from gtk+ and proceed with Qt. It looks like there is allot more support for Qt and everything seems to work right out of the box.
I'm sorry I couldn't publish a fix, but if binding is not necessary or if you want to use the dbus bindings then make sure to install the libgtkmm from the jessie-backports this seems to have some fixes plus removes the dependencies on gtk+ 2.0.
To enable the Backports run:
sudo nano /etc/apt/sources.list
and un-comment or insert:
deb http://httpredir.debian.org/debian jessie-backports main contrib non-free
#deb-src http://httpredir.debian.org/debian jessie-backports main contrib non-free
then use
sudo apt-get -t jessie-backports install libgtkmm-3.0-dev
this will install everything that you need for gtk+ including the dbus bindings.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.