• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem with defining an opaque structure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Problem with defining an opaque structure
      • From: Ondra Cada <email@hidden>
    • Re: Problem with defining an opaque structure
      • From: Chris Ridd <email@hidden>
  • Prev by Date: Re:NSCountWindowsForContext : How to get the context ?
  • Next by Date: Printing in COCOA
  • Previous by thread: Open, New, and Drag in DBA
  • Next by thread: Re: Problem with defining an opaque structure
  • Index(es):
    • Date
    • Thread