Re: g_list_append - cannot convert error



miette <linux_uber_alis yahoo com> writes:
I'm trying to create a GList, so I can add items to a
combo box. I use the following code:

GList *glist = NULL;
glist = g_list_append (glist, "String");

and I get this error:

cannot convert `const char *' to `void *' for 
argument `2' to `f_list_append (GList *, void *)'

Am I missing something? Using GTK 1.2.10.

In C++ a cast is required here, something like:

 g_list_append (glist, static_cast<void*>("String"))

In C you don't need that.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]