[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ethereal-dev
Subject:    Re: [ethereal-dev] Problem compiling with C++ compiler
From:       Gilbert Ramirez <gram () xiexie ! org>
Date:       2000-03-23 16:45:50
[Download RAW message or body]

On Thu, Mar 23, 2000 at 09:21:06AM -0600, andreas.sikkema@philips.com wrote:
> 
> 
> Hi
> 
> For a new plugin I have to use a C++ compiler. The compiler complains about 
> a couple of
> things that are easily corrected, but for some problems I don't know why 
> they are used there:
> 
> > ../..\proto.h(45) : error C2371: 'GNode' : redefinition; different basic 
> types
> >       C:\tools\gtk-dev\src\glib\glib.h(694) : see declaration of 'GNode'
> The line (and the one after it) in proto.h do this:
>   typedef struct GNode proto_tree;
>   typedef struct GNode proto_item;
> According to the compiler they redefine GNode, is that's supposed to 
> happen? I'm not that
> good at C, so I might be wrong here.

It's the opposite. The typedefs create types called 'proto_tree' and 'proto_item'
that are synonyms for 'struct GNode'.

> 
> ../..\packet.h(200) : error C2371: 'value_string' : redefinition; different 
> basic types
>         ../..\proto.h(47) : see declaration of 'value_string'
> Proto.h: struct value_string;
> Packet.h declares the struct, is this a forward declaration? Can 
> value_string be moved from
> packet.h to proto.h?

Yes, this is a forward declaration. I guess it could, since packet.h
includes proto.h. But the better question is to find out why the C++
compiler doesn't like valid C. I'm not a C++ user, so I can't answer that.

--gilbert

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic