I am using Ubuntu 8.04. I was trying to run the example program 'Hello World' in anjuta (GUI using glade). But, it generated errors.
This was the code that generated errors.
on_BT_EXIT_clicked (GtkButton *button, gpointer user_data)
on_BT_OK_clicked (GtkButton *button, gpointer user_data)
GtkWidget *entry = lookup_widget (GTK_WIDGET(button), "ENTRY");
GtkWidget *msgbox = gnome_app_new("Hello World", "Hello World");
gchar *text1, *text2;
text1 = gtk_entry_get_text (GTK_ENTRY(entry));
text2 = g_strconcat ("Hello, ", text1, NULL);
gnome_app_message (GNOME_APP(msgbox), text2);
This was the Error while linking the project.
callbacks.c:40: Undefined reference to 'lookup_widget'
Then I deleted the on_BT_OK_clicked section. Now on_BT_EXIT_clicked only remains. I compiled and built the project. But it showed running error. the main.c file resulted in the error. It was like this
# include <config.h>
/* For testing propose use the local (not installed) glade file */
/* #define GLADE_FILE PACKAGE_DATA_DIR"/hw/glade/hw.glade" */
#define GLADE_FILE "hw.glade"
gxml = glade_xml_new (GLADE_FILE, NULL, NULL);
/* This is important */
window1 = glade_xml_get_widget (gxml, "window");
main (int argc, char *argv)
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
window1 = create_window ();
This was the error I found on the terminal.
Gtk-CRITICAL **: gtk_widget_show: assertion 'GTK_IS_WIDGET (widget)' failed.
I also found that Glade does not automaticall generated the 'c code' for the button cliked and etc. In previous versions I notices a header file #include <gtk/gtk.h> on the callbacks.c file. But here nothing was there. I am using Anjuta 2.4.1 with Glade 3.4.2.
I have installed libgtk2.0 and also the dev files.
Please help me cure the problem.