Can't compile sample GTK app
There seems to be something wrong with either GCC or with GTK. I recently tried to compile the sample GTK application in a programming book I got, but it will not compile. It complains about do_click being undeclared, though it should be declared in gtk.h.
I'd been able to compile GTK programs with the same function doing the exact same thing before, so I don't know what's wrong.
Here's the program.
#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
int main(int argc, char *argv[]){
GtkWidget *window, *button;
int count = 0;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
//gtk_container_border_width(GTK_CONTAINER(window), 5);
button = gtk_button_new_with_label("Click to increment counter");
gtk_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(do_click), &count);
gtk_container_add(GTK_CONTAINER(window), button);
gtk_widget_show(button);
gtk_widget_show(window);
gtk_main();
return 0;
}
GCC 3.3.4 GTK +- 2.0
Last edited by slackwarefan; 07-25-2005 at 11:52 PM.
|