ฉันพยายามใช้คำสั่ง make เพื่อสร้าง ฉันกำลังดังต่อไปนี้ ฉันกำลังรวบรวมรหัสโดยใช้ภาษา GTK + 2 และ C
hp@ubuntu:~/amhello$ make
make all-recursive
make[1]: Entering directory `/home/hp/amhello'
Making all in src
make[2]: Entering directory `/home/hp/amhello/src'
gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c
main.c:3:20: fatal error: gtk/gtk.h: No such file or directory
compilation terminated.
make[2]: *** [main.o] Error 1
make[2]: Leaving directory `/home/hp/amhello/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/hp/amhello'
make: *** [all] Error 2
นี่คือรหัส main.c
#include<config.h>
#include<stdio.h>
#include<gtk/gtk.h>
void static call(GtkWidget *widget,gpointer data) {
g_print("%s \n",(gchar*) data);
}
int main(int agrc, char *agrv[]) {
gtk_init(&agrc,&agrv);
GtkWidget *window,*button;
window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(window,"delete-event",G_CALLBACK(gtk_main_quit),NULL);
gtk_window_set_title(GTK_WINDOW(window),"one button");
button=gtk_button_new_with_label("hello world");
g_signal_connect(button,"clicked",G_CALLBACK(call),(gpointer) "hello world");
gtk_container_set_border_width(GTK_CONTAINER(window),10);
gtk_container_add(GTK_CONTAINER(window),button);
gtk_widget_show_all(window);
gtk_main();
return (0);
}
/usr/include/gtk-2.0
มีไดเรกทอรีอยู่หรือไม่