我剛剛做了很多研究,並嘗試了這麼多,但沒有任何工作。我正在嘗試使用make在Cygwin中編譯一個簡單的Hello World程序。它給我錯誤:「lab0.c:1:21:錯誤:gtk/gtk.h:沒有這樣的文件或目錄....」 我安裝了所有軟件包的cygwin。我也將所有在一個gtk文件導入cygwin文件夾,但它給了我同樣的錯誤。下面是我的程序:GTK +使Cygwin錯誤
Lab0.c
#include <gtk/gtk.h>
int main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *label;
gtk_init (&argc, &argv);
/* create the main, top level, window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* give it the title */
gtk_window_set_title (GTK_WINDOW (window), "Hello World");
/* Connect the destroy signal of the window to gtk_main_quit
* When the window is about to be destroyed we get a notification and
* stop the main GTK+ loop
*/
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
/* Create the "Hello, World" label */
label = gtk_label_new ("Hello, World");
/* and insert it into the main window */
gtk_container_add (GTK_CONTAINER (window), label);
/* make sure that everything, window and label, are visible */
gtk_widget_show_all (window);
/* start the main loop, and let it rest there until the application is closed */
gtk_main();
return 0;
}
的makefile
# Makefile for Hello World Program (lab0).
all: lab0
lab0: lab0.o
g++ -Wall lab0.o -o lab0
lab0.o: lab0.c
g++ -Wall -c lab0.c -o lab0.o
我真的需要GTK工作。請幫幫我。
我安裝了所有在這個鏈接中找到的一個包:http://www.gtk.org/download-windows.html – user593301 2011-02-02 18:52:38