2013-05-31 45 views
2

在Windows 7 64位 我不斷收到錯誤 我已經下載了GTK包的Windows,提取,並進行了一些命令 我試圖在此基礎上條每頁 http://forums.codeblocks.org/index.php?topic=16468.0 IM停留在第3步我不知道該何去何從倉?來自哪裏? 還我不知道如何幫助用代碼塊設置gtk的步驟?

-------------- 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 

回答

2

這是我的代碼::塊設置GTK簡單的解釋做4A,4B 感謝。從http://www.gtk.org/download/win32.php

步驟2.提取它在C驅動器或任何其他地方 下載GTK + -bundle_2.24.10-20120208_win32.zip(所有功能於一個束):

步驟1。在我的情況下,C:\ GTK是我提取zip文件的目錄。

第3步。現在打開Code :: Blocks,從項目嚮導中選擇創建新項目,選擇GTK項目。給項目名稱「GTKsample」或給出您的選擇名稱。爲路徑提供路徑C:\ GTK用於解壓zip文件的GTK位置。創建gtk項目後,你會看到示例程序然後構建它,構建必須成功。

第4步。這是最後一步,直到第3步生成項目必須成功。當你嘗試運行這個項目時,你會得到一些錯誤信息,因爲我們沒有爲運行時庫(.dll文件)提供路徑,所以缺少一些.dll文件(運行庫)。爲此,請轉到您提取壓縮文件的目錄C:\ GTK。打開bin文件夾只複製所有.dll文件並將其粘貼到您的項目目錄GTKsample \ bin \ Debug \與項目可執行文件。在這種方法中,每次創建項目時都必須將所有.dll文件保留爲項目可執行文件,即(在項目\ bin \ Debug \文件夾中)。如果你不想要這個,那麼從bin文件夾複製並粘貼所有.dll文件到C:\ windows \ system32目錄。 現在運行該項目。您必須成功運行項目。

您可以按照此site一步一步的解釋與每一步的圖像。

+0

非常感謝我的朋友 –

+0

當我嘗試創建一個gtk +項目,當我指定gtk文件夾....它說無效的路徑.......請告訴我我失蹤.... –