[gtkmm] Re: Is Gtkmm stable and mature on Win32?



Ney André de Mello Zunino wrote:

Murray, when you say "there is an installer, with a demo included", do you mean the resources available on http://gladewin32.sourceforge.net/? The download options only mention GTK+; will I be able to use this Win32 port of Glade to generate GTKmm code, which is what I need?

Nevermind. I found this website of win32 ports [1] which provides a quite nice installer. Before running that installer, I downloaded and installed both MSYS and MingW. I tested the build environment with some simple programs and it seemed fine. Then I ran the installation of the GTKmm for Win32, which also went smooth. Next, I ran the GTK+ demo application and was happy to see that it worked as well (I reckon this assures my GTK+ runtime is fine).

The final step was trying to build a simple GUI using Glade. I did so and, at first, tried exporting it to C++ code, but it failed and showed me a message asking me to check whether I had glade-- installed, which I do (glademm V2.6.0_cvs). Anyway, I decided to try out my glade file with libglademm (which is the way I intend to go in my actual project). So, I wrote the following, minimal program:

#include <gtkmm.h>
#include <libglademm.h>

int main(int argc, char *argv[])
{
  Glib::RefPtr<Gnome::Glade::Xml> refXml =
    Gnome::Glade::Xml::create("teste.glade");
  return 0;
}

I tried to build it with:

g++ -o teste teste.cpp `pkg-config gtkmm-2.4 --cflags --libs`

This gave me the error message: "can't find the 'libglademm.h' include file". By invoking pkg-config directly, I could see that there actually was no '-I' option for libglademm's include directory. Why is that? Is it by default? If so, how can I manually change the "package definition" so that the libglademm include dir and lib file are included when I run pkg-config on the package gtkmm-2.4?

Anyway, by manually adding the include dir and lib file, I was finally able to build my simple test application. However, upon the first execution attempt, I got an error saying that I needed to call g_type_init() before the call in my main(). I did so, but then I was bombarded with tons of CRITICAL errors. The initial lines read:

(process:824): GLib-GObject-CRITICAL **: file gobject.c: line 1620 (g_object_set_qdata_full): assertion `quark > 0' failed

(process:824): Gtk-CRITICAL **: file gtksettings.c: line 447 (gtk_settings_get_for_screen): assertion `GDK_IS_SCREEN (screen)' failed

(process:824): GLib-GObject-CRITICAL **: file gobject.c: line 1222 (g_object_get): assertion `G_IS_OBJECT (object)' failed

(process:824): GLib-GObject-WARNING **: value "TRUE" of type `gboolean' is invalid or out of range for property `visible' of type `gboolean'

(process:824): Gtk-CRITICAL **: file gtksettings.c: line 447 (gtk_settings_get_for_screen): assertion `GDK_IS_SCREEN (screen)' failed

(process:824): GLib-GObject-CRITICAL **: file gobject.c: line 1222 (g_object_get): assertion `G_IS_OBJECT (object)' failed

Could anybody assist this newbie in successfully building that simple test application?

[1] http://www.pcpm.ucl.ac.be/~gustin/win32_ports/

Thank you in advance,

--
Ney André de Mello Zunino




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]