Problem with defining an opaque structure
Problem with defining an opaque structure
- Subject: Problem with defining an opaque structure
- From: Pierre-Olivier Latour <email@hidden>
- Date: Mon, 19 Aug 2002 15:41:09 +0200
Hi,
I'm trying to define an opaque structure:
struct OpaqueStructure;
typedef struct OpaqueStructure;
typedef OpaqueStructure* OpaqueStructurePtr;
typedef struct {
OpaqueStructurePtr stuff;
} OtherStructure;
OpaqueStructure content would be defined in another place of the source
code.
This does not work as GCC gets me the following errors:
main.m:13: undefined type, found `OpaqueStructure'
cpp-precomp: warning: errors during smart preprocessing, retrying in basic
mode
main.m:12: warning: useless keyword or type name in empty declaration
main.m:13: parse error before `*'
main.m:13: warning: type defaults to `int' in declaration of
`OpaqueStructurePtr'
main.m:13: warning: data definition has no type or storage class
main.m:16: parse error before `OpaqueStructurePtr'
main.m:16: warning: no semicolon at end of struct or union
main.m:17: warning: type defaults to `int' in declaration of
`OtherStructure'
main.m:17: warning: data definition has no type or storage class
I don't get what I'm doing wrong since as far as I remember this code works
with C/C++ compiler.
_____________________________________________________________
Pierre-Olivier Latour email@hidden
Lausanne, Switzerland
http://www.pol-online.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.