Hi,
I would like to have anyone to help me. I use MinGW+msys and gtk+-3.10.4 bundle to compile examples on the https://developer.gnome.org/gtk3/stable/gtk-getting-started.html.<https://developer.gnome.org/gtk3/stable/gtk-getting-started.html> The examples in Sections (Basics, Packing, and Building interfaces) are fine. However, following the instruction, I compile application 1-10, but no any application works. All errors are similar. I give application 1 error as follows. In file included from ../src/main.c:3:0: ../src/exampleapp.h:8:62: error: expected ')' before 'GtkApplication' G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication) ^ In file included from C:/MinGW/mingw64/include/glib-2.0/gobject/gobject.h:26:0, from C:/MinGW/mingw64/include/glib-2.0/gobject/gbinding.h:31, from C:/MinGW/mingw64/include/glib-2.0/glib-object.h:25, from C:/MinGW/mingw64/include/glib-2.0/gio/gioenums.h:30, from C:/MinGW/mingw64/include/glib-2.0/gio/giotypes.h:30, from C:/MinGW/mingw64/include/glib-2.0/gio/gio.h:28, from C:/MinGW/mingw64/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28, from C:/MinGW/mingw64/include/gtk-3.0/gdk/gdk.h:32, from C:/MinGW/mingw64/include/gtk-3.0/gtk/gtk.h:30, from ../src/main.c:1: ../src/main.c: In function 'main': ../src/main.c:8:44: warning: implicit declaration of function 'example_app_new' [-Wimplicit-function-declaration] return g_application_run (G_APPLICATION (example_app_new ()), argc, argv); ^ C:/MinGW/mingw64/include/glib-2.0/gobject/gtype.h:1920:57: note: in definition of macro '_G_TYPE_CIC' ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) ^ C:/MinGW/mingw64/include/glib-2.0/gio/gapplication.h:34:62: note: in expansion of macro 'G_TYPE_CHECK_INSTANCE_CAST' #define G_APPLICATION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ ^ ../src/main.c:8:29: note: in expansion of macro 'G_APPLICATION' return g_application_run (G_APPLICATION (example_app_new ()), argc, argv); ^ C:/MinGW/mingw64/include/glib-2.0/gobject/gtype.h:1920:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) ^ C:/MinGW/mingw64/include/glib-2.0/gobject/gtype.h:481:66: note: in expansion of macro '_G_TYPE_CIC' #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) ^ C:/MinGW/mingw64/include/glib-2.0/gio/gapplication.h:34:62: note: in expansion of macro 'G_TYPE_CHECK_INSTANCE_CAST' #define G_APPLICATION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \ ^ ../src/main.c:8:29: note: in expansion of macro 'G_APPLICATION' return g_application_run (G_APPLICATION (example_app_new ()), argc, argv); I also used gtk+3.6 bundle to compile these ten examples before. The same errors occurred. I used the codes both I downloaded and I input. The same errors occur. In order to resolve above issues, I wrote my own class. I can make it, but run time error occurs (editor.exe:2212): GLib-GObject-WARNING **: specified class size for type 'Examp leApp' is smaller than the parent type's 'GtkApplication' class size (editor.exe:2212): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed (editor.exe:2212): GLib-GObject-CRITICAL **: g_object_new: assertion 'G_TYPE_IS_ OBJECT (object_type)' failed. In addition, I used MinGW+msys and gtk+-3.6 bundle to compile another example from anther website and the example works fine. However, after my computer was scammed, I reinstalled MinGW+msys and gtk+-3.10.4 bundle and compile the same example. following warnings occur, ../src/editor.c: In function 'parameterizer_app_class_init': ../src/editor.c:652:39: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] G_APPLICATION_CLASS(class)->activate = parameterizer_app_activate; ^ ../src/editor.c:653:35: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] G_APPLICATION_CLASS(class)->open = parameterizer_app_open; ^ code: static void parameterizer_app_class_init(ParameterizerAppClass *class) { G_OBJECT_CLASS(class)->finalize = parameterizer_app_finalize; G_APPLICATION_CLASS(class)->activate = parameterizer_app_activate; G_APPLICATION_CLASS(class)->open = parameterizer_app_open; } If anyone can help me with these questions, I really appreciate. Thank you in advance, Song Getting Started with GTK+: GTK+ 3 Reference Manual<https://developer.gnome.org/gtk3/stable/gtk-getting-started.html> developer.gnome.org GTK+ is a widget toolkit. Each user interface created by GTK+ consists of widgets. This is implemented in C using GObject, an object-oriented framework for C ... _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list