0
由于已经由标题说_get_type(无效)GTK + requried方法,我得到一个编译错误我似乎无法修复:重新定义*
error: redefinition of 'tinygecko_notebook_get_type'
note: previous definition of 'tinygecko_notebook_get_type' was here
凡错误指向该行(第一这个码的片断):
GType
tinygecko_notebook_get_type (void)
{
static GType type = 0;
if (type == 0) {
static const GTypeInfo info = {
sizeof (TinygeckoNotebookClass), /* size of class struct */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc)tinygecko_notebook_class_init, /* class_init */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (TinygeckoNotebook),
0, /* n_preallocs */
(GInstanceInitFunc)tinygecko_notebook_init /* instance_init */
};
type = g_type_register_static (GTK_TYPE_NOTEBOOK, "TinygeckoNotebook", &info, 0);
}
return type;
}
和音符线指向的类型的设置
G_DEFINE_TYPE (TinygeckoNotebook, tinygecko_notebook, GTK_TYPE_NOTEBOOK);
个
两个片段位于.c文件内(在音符线是错误线以上)。
帮助赞赏..我很困惑。为什么要gtk +宏重新定义一个函数,我必须为自己的基于gobject的类initalizer和终结器(如果它们存在)设置(在这种情况下基于GtkNotebook)。