nitram
01-02-2003, 01:10
Hallo,
ich benutze Dev-C++ auf Windows und GTK 2.2.
Aber ich kann keine GTK-Scripts unter windows kompilieren, obwohl gtk anscheinend multiplattform ist. Ich bekomme dafuer immer ANSI C++ forbids!
Kann mir vielleicht jemand erklaeren, wie das dazu kommt??
Hier habe ich ein kleines Beispiel dafuer:
static gboolean
ole_make_bat (MSOleBAT const *metabat, size_t size_guess, guint32 block,
MSOleBAT *res)
{
/* NOTE : Only use size as a suggestion, sometimes it is wrong */
GArray *bat = g_array_sized_new (FALSE, FALSE,
sizeof (guint32), size_guess);
guint8 *used = g_alloca (1 + metabat->num_blocks / 8);
memset (used, 0, 1 + metabat->num_blocks / 8);
if (block < metabat->num_blocks)
do {
/* Catch cycles in the bat list */
g_return_val_if_fail (0 == (used[block/8] & (1 << (block & 0x7))), TRUE);
used[block/8] |= 1 << (block & 0x7);
g_array_append_val (bat, block);
block = metabat->block [block];
} while (block < metabat->num_blocks);
res->block = NULL;
g_return_val_if_fail (block == BAT_MAGIC_END_OF_CHAIN, TRUE);
res->num_blocks = bat->len;
res->block = (guint32 *) (gpointer) g_array_free (bat, FALSE);
return FALSE;
}
Fehlermeldung:
143 C:\Dev-Cpp\include\gsf\gsf-infile-msole.c
ANSI C++ forbids implicit conversion from `void *' in initialization
Danke,
Mah
ich benutze Dev-C++ auf Windows und GTK 2.2.
Aber ich kann keine GTK-Scripts unter windows kompilieren, obwohl gtk anscheinend multiplattform ist. Ich bekomme dafuer immer ANSI C++ forbids!
Kann mir vielleicht jemand erklaeren, wie das dazu kommt??
Hier habe ich ein kleines Beispiel dafuer:
static gboolean
ole_make_bat (MSOleBAT const *metabat, size_t size_guess, guint32 block,
MSOleBAT *res)
{
/* NOTE : Only use size as a suggestion, sometimes it is wrong */
GArray *bat = g_array_sized_new (FALSE, FALSE,
sizeof (guint32), size_guess);
guint8 *used = g_alloca (1 + metabat->num_blocks / 8);
memset (used, 0, 1 + metabat->num_blocks / 8);
if (block < metabat->num_blocks)
do {
/* Catch cycles in the bat list */
g_return_val_if_fail (0 == (used[block/8] & (1 << (block & 0x7))), TRUE);
used[block/8] |= 1 << (block & 0x7);
g_array_append_val (bat, block);
block = metabat->block [block];
} while (block < metabat->num_blocks);
res->block = NULL;
g_return_val_if_fail (block == BAT_MAGIC_END_OF_CHAIN, TRUE);
res->num_blocks = bat->len;
res->block = (guint32 *) (gpointer) g_array_free (bat, FALSE);
return FALSE;
}
Fehlermeldung:
143 C:\Dev-Cpp\include\gsf\gsf-infile-msole.c
ANSI C++ forbids implicit conversion from `void *' in initialization
Danke,
Mah