GTK+ "cannot convert `GObject*' to `GtkObject*'" error
I'm trying to learn GTK+ and am trying to write a basic program that has a button in a window and doesn't really do anything exciting.
I'm kinda doing this in a C++ way as well, but that shouldn't matter here. My code (the relevant bit) looks like this: Code:
int main(int argc, char *argv[]) filename.cc: In function `int main(int, char**)': filename.cc:18: error: cannot convert `GObject*' to `GtkObject*' for argument `1' to `gulong gtk_signal_connect_full(GtkObject*, const gchar*, void (*)(), void (*)(GtkObject*, void*, unsigned int, GtkArg*), void*, void (*)(void*), int, int)' I don't understand, because there's a line that looks almost identical to mine here and that compiles fine :confused:. Any ideas? All help appreciated! |
Well, it's been a couple of years since I did any GTK+ programming, but according to the API reference, gtk_signal_connect() takes a GtkObject as the first parameter, whereas you're casting it to a GObject. Plus gtk_signal_connect() has been deprecated, so you shouldn't be using it in the first place. Try changing that to use g_signal_connect() instead and see if that helps.
|
Retard (me, not you). I accidentally typed gtk_signal_connect instead of g_signal_connect. Thanks :).
|
All times are GMT -5. The time now is 01:37 AM. |