1
全部。我下載了一個簡單的GTK +源代碼,:我應該在哪裏放置gtk.h文件?
#include <gtk/gtk.h>
int main(int argc, char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);
gtk_main();
return 0;
}
當我運行它,
gcc -o simple simple.c `pkg-config --libs --cflags gtk+-2.0`
-bash: pkg-config: command not found
simple.c:1:21: error: gtk/gtk.h: No such file or directory
simple.c: In function ‘main’:
simple.c:5: error: ‘GtkWidget’ undeclared (first use in this function)
simple.c:5: error: (Each undeclared identifier is reported only once
simple.c:5: error: for each function it appears in.)
simple.c:5: error: ‘window’ undeclared (first use in this function)
simple.c:9: error: ‘GTK_WINDOW_TOPLEVEL’ undeclared (first use in this function)
它告訴我gtk.h丟失。但是我怎麼能得到gtk.h?我如何讓程序運行?謝謝。