这几天试着用Code::Blocks来编译GTK的程式,发现使用这个GTK 2.24的all-in-one bundle会有一些问题,第一个问题就是找不到gdk-pixbuf-2.0的问题,这个问题Google的到答案,用
project.AddIncludeDir(GtkPathDefaultInc + wxFILE_SEP_PATH + _T(“gdk-pixbuf-2.0”));
这一行加入到C:\Program Files\CodeBlocks\share\CodeBlocks\templates\wizard\gtk这里wizard.script中的125行,就可以解决了,这一行跟124行那边的指令码相似,看起来就知道是在搜寻gdk-pixbuf-2.0的路径。
第二个问题就难解了,我得到这样的讯息:
(20120223.exe:840): Gdk-WARNING **: gdk_win32_pixmap_new: depth = 16 not support
ed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable
!= NULL’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (
gc)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_draw_rectangle: assertion `GDK_IS_GC (g
c)’ failed
(20120223.exe:840): Pango-WARNING **: couldn’t load font “新宋体 Not-Rotated 9
“, falling back to “Sans Not-Rotated 9”, expect ugly output.
(20120223.exe:840): Gdk-WARNING **: gdk_win32_pixmap_new: depth = 16 not support
ed
(20120223.exe:840): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJE
CT (object)’ failed
(20120223.exe:840): Gdk-CRITICAL **: gdk_drawable_get_size: assertion `GDK_IS_DR
AWABLE (drawable)’ failed
可以正常编译,但是执行就会有这样复杂的错误讯息,后来还是Google到说我的显示卡设定有问题,咦,有点印象了,因为之前电脑太慢,把解析度设成
色彩品质为中(16位元)了,Orz,改设回最高(32位元)吧。问题终于解决,但是另外有个问题,如果我只能玩16为元的显示,那GTK可以玩吗?