请问谁用过GTK+作过开发
发表于 : 2006-12-29 13:54
When I compile an open sourece project, which bases on GTK+, one file containing the following code can't get linked:
void log_txt(gchar *to_write){
GtkWidget *W;
W = lookup_widget (GTK_WIDGET (w_main), "log_zone");
gtk_text_insert (GTK_TEXT (W), NULL, NULL,NULL, to_write,-1);
}
Always this error report:
callbacks.o: In function `log_txt':/home/user/Desktop/openha-0.3.6/src/callbacks.c:277: undefined reference to `GTK_TEXT'
collect2: ld returned 1 exit status
At first I think the head file is not included, but after checking, I find that the head file has already been included, now I doubted that the type of variable"W" is not acceptable here, but I can't find out the object inheritance hierarchy of GtkWidget, does anyone here has the coding experience of GTK+?
Here is the declare of GTK_TEXT:
#define GTK_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT, GtkText))
void log_txt(gchar *to_write){
GtkWidget *W;
W = lookup_widget (GTK_WIDGET (w_main), "log_zone");
gtk_text_insert (GTK_TEXT (W), NULL, NULL,NULL, to_write,-1);
}
Always this error report:
callbacks.o: In function `log_txt':/home/user/Desktop/openha-0.3.6/src/callbacks.c:277: undefined reference to `GTK_TEXT'
collect2: ld returned 1 exit status
At first I think the head file is not included, but after checking, I find that the head file has already been included, now I doubted that the type of variable"W" is not acceptable here, but I can't find out the object inheritance hierarchy of GtkWidget, does anyone here has the coding experience of GTK+?
Here is the declare of GTK_TEXT:
#define GTK_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT, GtkText))