GTypeInfo problems..
Francis Brosnan Blázquez <[email protected]> 31 Dec 2002 14:48:10 +0100
| Newsgroups | gmane.network.beep.roadrunner.general |
|---|---|
| Organization | Advanced Software Production Line, S.L. |
| Message-ID | <[email protected]> |
--=-jFbw65e1qymodR2q1PFv
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable
Hi.
I don't if this is the right place to ask about my problem, so excuse
me. X'D
I want to allow to configure which handler will be executed when
something happens, so I have created a public structure that has to be
passed to my GType init function. My function looks as follow:
GType=20
coyote_simple_get_type (gconstpointer user_data)
{
static GType rr_type =3D 0;
if (!rr_type) {
static GTypeInfo type_info =3D {
sizeof (CoyoteSimpleClass),
NULL,
NULL,
(GClassInitFunc) coyote_simple_class_init,
NULL,
user_data,
sizeof (CoyoteSimple),
16,
(GInstanceInitFunc) coyote_simple_init
};
rr_type =3D g_type_register_static (RR_TYPE_CHANNEL,=20
"CoyoteSimple",=20
&type_info, 0);
/* Tell RoadRunner which URI this profile will=20
* identify itself with */
rr_channel_set_uri (rr_type, COYOTE_SIMPLE_URI);
}
return rr_type;
}
In this function I pass "user_data" param to the GTypeInfo structure,
but when I compile it I get the following error:
/bin/sh ../libtool --mode=3Dcompile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/libxml2 -g -O2 -c coyote_simple.c
rm -f .libs/coyote_simple.lo
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -g -O2
-Wp,-MD,.deps/coyote_simple.pp -c coyote_simple.c -fPIC -DPIC -o
.libs/coyote_simple.lo
coyote_simple.c: In function `coyote_simple_get_type':
coyote_simple.c:138: initializer element is not constant
coyote_simple.c:138: (near initialization for `type_info.class_data')
make: *** [coyote_simple.lo] Error 1
Has anybody any idea about this?
Greetings! and happy new year!
--=20
Francis Brosnan Bl=E1zquez <[email protected]>
Advanced Software Production Line, S.L.
--=-jFbw65e1qymodR2q1PFv
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Esta parte del mensaje esta firmada digitalmente
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQA+EaAZKpXqflIzvBcRAnMzAJwKfFtqZ6sKS9QXEYcz+lgNjovTAwCeMPwB
Y4WqXU+vExwBV86dwaZEEso=
=MJOb
-----END PGP SIGNATURE-----
--=-jFbw65e1qymodR2q1PFv--