使用代码块设置gtk的步骤?

使用代码块设置gtk的步骤?,gtk,codeblocks,Gtk,Codeblocks,在windows 7中,64位 我总是出错 我已经下载了适用于windows的gtk包,将其解压缩并运行了一些命令 我正试图以这篇文章为基础 我被困在第三步我不知道是什么垃圾箱?从哪里来? 我也不知道怎么做4a,b 谢谢你的帮助 -------------- Build: Debug in zxc --------------- Compiling: main.c In file included from C:\gtk\include\gtk-2.0/gdk/gdk.h:32,

在windows 7中,64位 我总是出错 我已经下载了适用于windows的gtk包,将其解压缩并运行了一些命令 我正试图以这篇文章为基础 我被困在第三步我不知道是什么垃圾箱?从哪里来? 我也不知道怎么做4a,b 谢谢你的帮助

-------------- Build: Debug in zxc ---------------

Compiling: main.c
In file included from C:\gtk\include\gtk-2.0/gdk/gdk.h:32,
                 from C:\gtk\include\gtk-2.0/gtk/gtk.h:32,
                 from C:\Users\Administrator\Desktop\AlphaBook\zxc\main.c:2:
C:\gtk\include\gtk-2.0/gdk/gdkapplaunchcontext.h:30:21: error: gio/gio.h: No such file or directory
In file included from C:\gtk\include\gtk-2.0/gdk/gdkapplaunchcontext.h:31,
                 from C:\gtk\include\gtk-2.0/gdk/gdk.h:32,
                 from C:\gtk\include\gtk-2.0/gtk/gtk.h:32,
                 from C:\Users\Administrator\Desktop\AlphaBook\zxc\main.c:2:
C:\gtk\include\gtk-2.0/gdk/gdkscreen.h:31:19: error: cairo.h: No such file or directory
In file included from C:\gtk\include\gtk-2.0/gdk/gdkscreen.h:32,
                 from C:\gtk\include\gtk-2.0/gdk/gdkapplaunchcontext.h:31,
                 from C:\gtk\include\gtk-2.0/gdk/gdk.h:32,
                 from C:\gtk\include\gtk-2.0/gtk/gtk.h:32,
                 from C:\Users\Administrator\Desktop\AlphaBook\zxc\main.c:2:
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:36:18: error: glib.h: No such file or directory
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:37:25: error: pango/pango.h: No such file or directory
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:38:25: error: glib-object.h: No such file or directory
In file included from C:\gtk\include\gtk-2.0/gdk/gdkscreen.h:32,
                 from C:\gtk\include\gtk-2.0/gdk/gdkapplaunchcontext.h:31,
                 from C:\gtk\include\gtk-2.0/gdk/gdk.h:32,
                 from C:\gtk\include\gtk-2.0/gtk/gtk.h:32,
                 from C:\Users\Administrator\Desktop\AlphaBook\zxc\main.c:2:
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:68: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:78: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GdkWChar'
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:95: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GdkNativeWindow'
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:184: error: expected ')' before 'data'
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:190: error: expected ')' before 'data'
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:196: error: expected specifier-qualifier-list before 'gint'
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:202: error: expected specifier-qualifier-list before 'gint'
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:210: error: expected specifier-qualifier-list before 'gint'
C:\gtk\include\gtk-2.0/gdk/gdktypes.h:218: error: expected specifier-qualifier-list before 'gint'
In file included from C:\gtk\include\gtk-2.0/gdk/gdkevents.h:34,
                 from C:\gtk\include\gtk-2.0/gdk/gdkdisplay.h:32,
                 from C:\gtk\include\gtk-2.0/gdk/gdkscreen.h:33,
                 from C:\gtk\include\gtk-2.0/gdk/gdkapplaunchcontext.h:31,
                 from C:\gtk\include\gtk-2.0/gdk/gdk.h:32,
                 from C:\gtk\include\gtk-2.0/gtk/gtk.h:32,
                 from C:\Users\Administrator\Desktop\AlphaBook\zxc\main.c:2:
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'G_BEGIN_DECLS'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:71: error: expected specifier-qualifier-list before 'GObject'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:85: error: expected specifier-qualifier-list before 'GObjectClass'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:89: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_colormap_get_type'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:92: error: expected declaration specifiers or '...' before 'gboolean'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:106: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_colormap_get_system_size'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:112: error: expected declaration specifiers or '...' before 'gint'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:115: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_colormap_alloc_colors'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:121: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_colormap_alloc_color'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:127: error: expected declaration specifiers or '...' before 'gint'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:129: error: expected declaration specifiers or '...' before 'gulong'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:136: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_color_parse'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:138: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_color_hash'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:139: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_color_equal'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:141: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:143: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_color_get_type'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:149: error: expected declaration specifiers or '...' before 'gint'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:150: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_color_white'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:152: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_color_black'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:154: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_color_alloc'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:156: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_color_change'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:162: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_colors_alloc'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:169: error: expected declaration specifiers or '...' before 'gulong'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:170: error: expected declaration specifiers or '...' before 'gint'
C:\gtk\include\gtk-2.0/gdk/gdkcolor.h:171: error: expected declaration specifiers or '...' before 'gulong'
In file included from C:\gtk\include\gtk-2.0/gdk/gdkevents.h:36,
                 from C:\gtk\include\gtk-2.0/gdk/gdkdisplay.h:32,
                 from C:\gtk\include\gtk-2.0/gdk/gdkscreen.h:33,
                 from C:\gtk\include\gtk-2.0/gdk/gdkapplaunchcontext.h:31,
                 from C:\gtk\include\gtk-2.0/gdk/gdk.h:32,
                 from C:\gtk\include\gtk-2.0/gtk/gtk.h:32,
                 from C:\Users\Administrator\Desktop\AlphaBook\zxc\main.c:2:
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:36: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'G_BEGIN_DECLS'
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:76: error: expected specifier-qualifier-list before 'GObject'
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:100: error: expected specifier-qualifier-list before 'GObjectClass'
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:106: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gdk_drag_context_get_type'
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:108: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:111: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:112: error: expected ')' before '*' token
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:113: error: expected ')' before '*' token
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:114: error: expected ')' before '*' token
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:116: error: expected ')' before '*' token
C:\gtk\include\gtk-2.0/gdk/gdkdnd.h:117: error: expected ')' before '*' token
Process terminated with status 1 (1 minutes, 1 seconds)
50 errors, 0 warnings

这是我在Code::blocks中设置GTK的简单解释

步骤1: 从下载gtk+-bundle_2.24.10-20120208_win32.zip(一体式捆绑包)

第二步。在c驱动器或任何其他位置提取。在我的例子中,C:\GTK是我提取zip文件的目录

第三步。现在打开Code::Blocks,从项目向导slect GTK project创建新项目。请给出项目名称“GTKsample”或您选择的名称。为提取zip文件的GTK位置提供路径C:\GTK。创建gtk项目后,您将看到示例程序,然后构建它,构建必须成功

第四步。这是最后一步,直到第3步,构建项目必须成功。当您尝试运行该项目时,您将收到消息.dll文件(运行时库)丢失,因为我们没有为运行时库(.dll文件)提供路径。为此,转到解压缩zip文件的C:\GTK目录。打开bin文件夹,仅复制所有.dll文件,并使用项目可执行文件将其粘贴到项目目录GTKsample\bin\Debug\。在该方法中,每次创建项目时,都必须将所有.dll文件与项目可执行文件(即project\bin\Debug\folder内)一起保留。如果不需要,请将所有.dll文件从bin文件夹复制并粘贴到C:\windows\system32目录。 现在运行项目。您必须已成功运行项目


您可以按照此逐步解释每个步骤的图像。

当我尝试创建gtk+项目和指定gtk文件夹时……它显示无效路径……。请告诉我缺少什么。。。。