0
#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’
4

1 回答 1

4

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

于 2012-06-19T12:54:16.063 回答