Re: Gtk and C++ ?




Matt Goodall <mgg@isotek.co.uk> writes:

> > and when I use gcc to compile, it raises the following error :
> >
> > hellogtk.cpp: In function `int main(...)':
> > hellogtk.cpp:21: ANSI C++ forbids implicit conversion from `void *' in
> > argument passing
> 
> The problem is that glib defines NULL like this:
> 
>     #define NULL ((void*) 0)
> 
> but gtk_signal_connect_object expects a GtkObject* as the last
> parameter. Either cast the NULL to a GtkObject* or just use 0 (zero)
> instead.

Or, (until we fix this) the easy workaround is

#define NULL 0
#include <gtk/gtk.h>

Since the redefinition is in a #ifndef.

Regards,
                                        Owen



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