错误:未知类型名称'GtkObject'

时间:2012-06-19 12:09:01

标签: c gtk

#include <gtk/gtk.h>
#include <gtksourceview/gtksourceview.h>

static gboolean delete_event(GtkWidget *widget, GdkEvent  *event, gpointer data) {
  gtk_main_quit();
}

int main(int argc, char *argv[]) {
  gtk_init (&argc, &argv);

  /* Set up window */
  GtkWidget *window;
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  g_signal_connect(window, "delete-event", G_CALLBACK(delete_event), NULL);

  /* Draw widgets */
  gtk_widget_show (window);

  gtk_main ();

  return 0;
}

这是我的代码,我正在编译:

gcc -o file `pkg-config --cflags --libs gtk+-3.0 gtksourceview-2.0` file.c

知道我做错了什么吗?谢谢。

In file included from /usr/include/gtksourceview-2.0/gtksourceview/gtksourceview.h:30:0,
                 from lidedit.c:2:
/usr/include/gtksourceview-2.0/gtksourceview/gtksourcecompletion.h:60:2: error: unknown type name ‘GtkObject’

1 个答案:

答案 0 :(得分:4)

gtksourceview 2需要GTK + -2。要与GTK + -3一起使用,您应该使用gtksourceview 3。