delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/31/04:34:15

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Thu, 31 Jan 2002 11:06:03 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: Linked Lists Help!
In-Reply-To: <kinghuang-0D63B9.23404830012002@news.uncensored-news.com>
Message-ID: <Pine.SUN.3.91.1020131110358.26396N-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 31 Jan 2002, King Chung Huang wrote:

> typedef struct {
>    // metadata
>     char name[256];         // window title name
>     unsigned short x;       // x co-ordinate position of the window
>     unsigned short y;       // y co-ordinate position of the window
>     unsigned short width;   // width of the content region (local)
>     unsigned short height;  // height of the content region (local)
>     short isDirty;          // does the window need updating?
>     
>    // content data
>    struct qdPort *qdRef;   // the qdPort
>    
>    // links
>    struct qdWindow *above; // next window above
>    struct qdWindow *below; // next window below
> } qdWindow;
> [...]
> The problem i'm having is that when i go to compile, every line that has 
> "newWindow -> (some field) = (something)" generates the error 
> "dereferencing pointer to incomplete type".

That's because your `typedef' declaration doesn't name the struct, only 
the typedef.  The struct is anonymous.  Change this line:

   typedef struct {

into this:

   typedef struct qdwindow {

and the problem should go away.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019