Re: [gnome-love] natilus text component compilation issues.



----- Original Message -----
From: "Chema Celorio" <chema ximian com>
To: "Josh Steiner" <joschi eds org>
Cc: <gnome-love gnome org>
Sent: Friday, November 30, 2001 12:58 AM
Subject: Re: [gnome-love] natilus text component compilation issues.


On Thu, 2001-11-29 at 16:45, Josh Steiner wrote:
Hey y'all, I've started trying to get the Nautilus text view component
to
compile and am I'm getting hung up on this error:

nautilus-text-view.c: In function `get_selected_text':
nautilus-text-view.c:479: dereferencing pointer to incomplete type
nautilus-text-view.c:479: dereferencing pointer to incomplete type
nautilus-text-view.c:479: dereferencing pointer to incomplete type
nautilus-text-view.c:483: dereferencing pointer to incomplete type
nautilus-text-view.c:483: dereferencing pointer to incomplete type
nautilus-text-view.c: In function `update_service_menu_items':
nautilus-text-view.c:748: dereferencing pointer to incomplete type
nautilus-text-view.c:748: dereferencing pointer to incomplete type
nautilus-text-view.c:748: dereferencing pointer to incomplete type
make[1]: *** [nautilus-text-view.o] Error 1
make[1]: Leaving directory `/gnome/head/cvs/nautilus/components/text'
make: *** [all-recursive] Error 1

in the fucntion:

static char *
get_selected_text (GtkEditable *text_widget)
{
  if (!text_widget->has_selection || text_widget->selection_start_pos ==
    text_widget->selection_end_pos) {

    return NULL;
  }

  return gtk_editable_get_chars (text_widget,
    text_widget->selection_start_pos, text_widget->selection_end_pos);
}

This is a common C problem. What it means is that C does not know the
structure of GtkEditable, so when it reaches : text_widget->some_member
it does not know what to do with it. The solution would be to make the
structure available to this code so that it can calculate the offsets
correctly.

However I would guess that this code is already including <gnome.h> or
<gtk.h> and i don't see how anybody else could compile this code. This
might be that you are trying to compile nautilus for gnome 2.0 with gtk
1.2, or that gcc is finding the gnome 1.4 headers before the 2.0 ones.
If you got the code from cvs make sure you have the right branch.

regards,
Chema



If you compare the gtk 1.2 headers to the 2.0 headers you will see that the
those fields in the GtkEditable structure are no longer public. The solution
is to use the api available -
gtk_editable_get_selection_bounds instead of the data structrue itsself -
ie.

gint start_pos, end_pos;
gboolean has_selection;
has_selection = gtk_editable_get_selection_bounds (text_widget, &start_pos,
&end_pos);

Nautilus text view should really be ported to GtkTextView instead of the
deprecated GtkText widget that it currently uses, hence it would no longer
be derived from GtkEditable.

Regards,
Kevin






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