Re: g_object_new() and g++



----- Original Message -----
From: "Adrian Immler" <a immler 12mm de>
To: <gtk-app-devel-list gnome org>
Sent: Saturday, January 25, 2003 6:43 PM
Subject: g_object_new() and g++


hi all !


i am having problems compiling the very reduced code snipped below.
my build command is:

g++ -Wall -g test.c -o test `pkg-config --clags gtk+-2.0` \
  `pkg-config --libs gtk+-2.0`

it ends up with:
"cannot convert `void*` to `GtkTreeView*` in assignment"

when i replace the "g++" through "gcc" it works. but i need to use g++.
any idea ?

thanks in advance

======================



#include <gtk/gtk.h>
#include <glib.h>

int main( gint argc, gchar *argv[] ){
  gtk_init (&argc, &argv);

  GtkListStore *liste;
  GtkTreeView *ansicht;

  liste = gtk_list_store_new(3, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING);

  ansicht = g_object_new(GTK_TYPE_TREE_VIEW,

ansicht  = static_cast<GtkTreeView*>(g_object_new(...));

or simply in a good old C manner

ansicht  = (GtkTreeView*)(g_object_new(...));

I persume this would help.
C++ is somtimes fussy about types.

Michal "Gleba" Ziemski






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