#include
<gtk/gtk.h>#include
<glib.h>#include
<stdio.h>#include
<string.h>gint destroyapp (GtkWidget *widget, gpointer gdata)
{
g_print ("Quitting...\n");
gtk_main_quit();
return (FALSE);}
void
button_clicked(GtkWidget *widget, gpointer gdata){
gtk_main_quit();
int
main(int argc,char *argv[]){
GtkWidget *window,*label,*box,*separator,*exit_btn;
gtk_init(&argc,&argv);
window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
Gtk_Widget_show(window);
box=gtk_vbox_new(FALSE,10);
label=gtk_label_new("gtk");
separator=gtk_hseparator_new();
exit_btn=gtk_button_new_with_label("exit");
Gtk_Widget_show(label);
Gtk_Widget_show(box);
Gtk_Widget_show(separator);
Gtk_Widget_show(exit_btn);
Gtk_main();
return 0;}
}
int
main (int argc, char *argv[]){
GtkWidget *window;
GtkWidget *button;
gtk_init (&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
button = gtk_button_new_with_label("Click Me");
gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(destroyapp), NULL);
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(button_clicked), NULL);
gtk_container_add(GTK_CONTAINER (window), button);
gtk_container_border_width (GTK_CONTAINER (window), 15);
gtk_widget_show(button);
gtk_widget_show(window);
gtk_main();
return 0;}
The errors are as follows:
/tmp/cclYSbJO.o(.text+0x55): In function `main.0':
: undefined reference to `Gtk_Widget_show'
/tmp/cclYSbJO.o(.text+0xa3): In function `main.0':
: undefined reference to `Gtk_Widget_show'
/tmp/cclYSbJO.o(.text+0xb1): In function `main.0':
: undefined reference to `Gtk_Widget_show'
/tmp/cclYSbJO.o(.text+0xbf): In function `main.0':
: undefined reference to `Gtk_Widget_show'
/tmp/cclYSbJO.o(.text+0xcd): In function `main.0':
: undefined reference to `Gtk_Widget_show'
/tmp/cclYSbJO.o(.text+0xd5): In function `main.0':
: undefined reference to `Gtk_main'
collect2: ld returned 1 exit status.